elepil
asked on
jQuery question
I don't understand something.
The browser will actually display '<b>Boo</b>' without boldfacing the word 'Boo'. When I examine the source through the browser's debugger (e.g. webkit), the text doesn't show the output as using HTML entities like > or <, nor are any of the characters escaped in any way.
Can someone please explain to me what's happening here?
$("#myDiv").text("<b>Boo</b>");
<div id="myDiv"></div>
The browser will actually display '<b>Boo</b>' without boldfacing the word 'Boo'. When I examine the source through the browser's debugger (e.g. webkit), the text doesn't show the output as using HTML entities like > or <, nor are any of the characters escaped in any way.
Can someone please explain to me what's happening here?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It won't show in view source because that is the rendered HTML at load, anything you add is in the browsers DOM
Jquery will html encode the < and > etc to their equivalent (> or <) but when you view it the debugger you will see the actual < >
Jquery will html encode the < and > etc to their equivalent (> or <) but when you view it the debugger you will see the actual < >
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for all your help!
ASKER