double-quote or single-quote around the string to delimit it.
However I can't get PHP to build the same string and output it using:
- Code: Select all
<?php
$exp = "document.getElementsByName(\"Route\")[0].textContent=\"+\";";
echo $exp;
echo "<form name='LoopForm' onsubmit='' action='Bump-Up.php' method='post'>
Level Up/Down Test <br><br>
<input type='text' name='Level' value='1' /> <br><br>"
echo "<input type='submit' name='PlusButton' value= ' + ' onclick='$exp' />
<input type='submit' name='MinusButton' value= ' - ' onclick='SetMinus();' />
<span name='Route'></span></form>
"
?>
Anyone have a suggestion on how to get it to work ?
Final Output I want:
- Code: Select all
<input type='submit' name='PlusButton' value= ' + ' onclick='document.getElementsByName("Route")[0].textContent="+";' />
Which works fine if just in HTML.
.