I tried to create something that would search the whole webpage for specific keywords and use the pure JavaScript Italicize them for I have not tried anything with Javascript lately, so I do not know why this is not working. I have tried to googling, but for my problem there was no particular benefit (everything that I found was only trying to change the The result should be: There was a ship run by Nautilus Captain Nemo . My UN-experienced logic tells me that I should try to parse the entire document as a large string, then using that string it will match the word using the rags, then Now, as I said, because I have been busy, I have not touched Javascript or even Jacques for a while, so I can be closed, but any help would be greatly appreciated. ! To do this you should: or In JS: See it working here: class of an element as opposed to the original CSS property having had). I really want to know why why is not working here is what I have done so far:
& lt; Html & gt; & Lt; Top & gt; & Lt; Script & gt; Var str = document.getElementsByTagName ("*"). InnerHTML; Var n = str.match (/ (Nautilus | Capture Nemo) / i); N.style.fontStyle = "Italic"; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; Nautilus was a ship powered by Captain Nemo & Lt; / Body & gt; & Lt; / Html & gt;
Style.fontStyle .
n Here's just a string, this is not a node on the page and On the page, there may be styles in only one node which are different from their parents. You can not just tell the string to be italic. This is just a string and it does not have any associated presentation information.
// get all body contents as a string Str = document.body.inner HTML; // Find all the magic words and give them the & lt; Em> Tag Vertical Results = str.replace (/ (Nautilus | Capture Nemo) / ig, "
No comments:
Post a Comment