I have a razor syntax like this:
foreach(var item in model)
{
<td><a href ="#" onclick="Getinfo(@item.email);" >6/16/2016 2:02:29 AM</a> </td>
}
My javascript that recieves the request goes like this:
<script type="text/javascript" src="~/Scripts/jquery-1.9.1.js"></script>
<script type="text/javascript">
function Getinfo(elem) {
var email = document.getElementById(elem).innerHTML;
}
</script>
When clicking on the href link, I get the following error in the console of the browser:
"Uncaught SyntaxError: Invalid or unexpected token",
and this part is underlined:
**</a> </td>**
I am a beginner so I get stuck in syntax a lot. If it is that then please help me out.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…