Consider the following HTML code:
<img/asimpletest/onerror=alert('Error') src=test /> I'm very confused with the slash / in the code above. With the junk code /asimpletest/, the web browser (both IE and Chrome) can also pop up the messagebox "Error". Is there any meaning with the slash and the content in it?
<img onerror=alert('Error') src=test /> 12 Answers
You usually use the slash / (in HTML I mean) when you have to close a particular tag:
<p align="center"> text </p> In this case your code is wrong because you didn't use the slash in the correct way. Look here an example
<img src="image.gif" onerror="alert('Error')"> Also, /asimpletest/ is useless. Remove it.
/asimpletest/ doesnot add to anything
This will surely work fine without junk data you are referring to