Looks OK to me. If the above is a double quote delimited element event, the string value needs to be delimited by single quotes. Otherwise, there is something else about your page or the code that prevents it from happening.
Please post a link to the page on your site that contains the problematic code so we can check it out.
To put it another way, this works:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<input type="text" assocSpan="blah" onchange="var xy = this.getAttribute('assocSpan');
var spanTxt = 'The contents of this field are too long!';
var dc=document.getElementById( xy );
dc.innerHTML=spanTxt;"><br>
<span id="blah"></span>
</body>
</html>
Bookmarks