escaping - Escape single quote in html (Greasemonkey script) -


i have html code working on greasemonkey extension webbrowsers:

document.body.innerhtml=document.body.innerhtml.replace("value=\"9,00\"","value=\"4,00\""); 

but want match full line:

<td><input name='nota3'  size='5' readonly value="9,00" > 

i've tried escape single quotes doublequotes in first example not working:

document.body.innerhtml=document.body.innerhtml.replace("<td><input name=\'nota3\'  size=\'5\' readonly value=\"9,00\" >","<td><input name=\'nota3\'  size=\'5\' readonly value=\"4,00\" >"); 

how can it?

try this:

document.body.innerhtml=document.body.innerhtml.replace("<td><input name='nota3'  size='5' readonly value=\"9,00\" >","<td><input name='nota3'  size='5' readonly value=\"4,00\" >"); 

you don't need escape single quotes, because they're enclosed in double quotes, , therefore not interfere closing double quotes.


Comments