I am trying to display the (outer)html of an img
tag, but I want the alt
attribute to be in red.
The way I get the string:
var img_outerHTML = img[0].outerHTML;
This gives me the string:
<img alt="main-logo" src="main-logo.png">
So how can I have main-logo
to be red?
Thank you!
EDIT
Thanks to techfoobar
for the solution and everyone else that helped!
Here is a jsFiddle Example.