B
Bill Steele
e,g,.
function changeText () {
var content = 'He said "Hello, World!"'
var destination = document.getElementByID("foo")
destination.innerHTML = content
}
<bosdy>
<div id="foo"
<a href="javascript:ChangeText()">What did he say?</a>
The book says the double quotes are fine inside single quotes. In
practice they act as the end of the script. Escaping them doesn't work.
(Escaping single quotes and apostrophes does work. )
function changeText () {
var content = 'He said "Hello, World!"'
var destination = document.getElementByID("foo")
destination.innerHTML = content
}
<bosdy>
<div id="foo"
<a href="javascript:ChangeText()">What did he say?</a>
The book says the double quotes are fine inside single quotes. In
practice they act as the end of the script. Escaping them doesn't work.
(Escaping single quotes and apostrophes does work. )