I am very new in Javascript.
I want to make some basic stuffs that can be used in my future project.
One of the stuffs I need is highlighting some keywords.
You can find the working code for the functionality at the above link.
The problem is if I uncomment the following line in HTML,
<!-- <h1>Polls show Romney surging ahead of Gingrich in Florida</h1> -->
The functionality does not work.
What is the problem and how to solve the problem?
You can’t have block level elements inside a paragraph tag.
If you want the heading to be inside the
<p>and searchable then change the<p>to a<div>http://jsfiddle.net/4wMjP/2/