Can't figure out how to fix a word replace javascript -


i want change words on page below script. m not sure how fix ... can help?

http://jsfiddle.net/cip691/yums7/

var dict = {     "not": " not ",     "is not": " not ",     "like": " likeeee ",     "like": "lllike",     "job": "job" },     terms = [],     term; (term in dict) { terms.push(term); var search = new regexp('\\b(' + terms.join('|') + ')\\b', 'g');                 }; // every text node: textnode.data = textnode.data.replace(search, function(full, match) {     return dict[match] || match; });​ 

you should define textnode

like in example

link example

<head>     <script type="text/javascript">         function gettextnode () {             var textcontainer = document.getelementbyid ("textcontainer");             var textnode = textcontainer.firstchild;             alert (textnode.data);         }     </script>  </head> <body>     <div id="textcontainer">this simple text in container.</div>     <button onclick="gettextnode ()">get contents of container</button> </body> 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -