I am using Server Side variable as <%=value01%> and I need the a JavaScript function to be done if value01 is an email address. I have written a JavaScript in the below way which is not working. Anybody please correct it.
var myem = document.getElementByTagName('value01').value;
if(myem.value.match(/[.].*[@]|[@].*[.]/))
{
alert('Value contains email');
}
Try a hidden input or preferably use the HTML5
data-attributes:Javascript: