Javascript examples for jQuery Method and Property:html
Replace < with < and > with > using jquery
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.2.js"></script> <script type="text/javascript"> $(function(){/*from w ww .j a va 2 s . co m*/ $('#test').each(function(){ var $this = $(this); var t = $this.text(); $this.html(t.replace('<','<').replace('>', '>')); }); }); </script> </head> <body> <div id="test"> <span style="font-weight:bold;"&gtHello world!<span> </div> </body> </html>