I’m trying to validate the following code (Inside a XHTML transitional doc):
<a href="#" onclick="document.getElementById('courseFrameBottomRight').innerHTML = '<iframe src=\'descriptions/bf_isc.html\' scrolling=\'no\' frameborder=\'0\'></iframe>'" id='onClickTextChange2'><span class="title">Website</span></a>
However, this is throwing a huge number of validation errors.
Example:
Line 168, Column 98: character “<” is
the first character of a delimiter but
occurred as data
The code is modified from a help guide and I don’t have experience with the nested quoting or back-slashing going on here. Can someone offer some quick syntax pointers for me to get this valid for
XHTML Transitional? Thanks!
Try backslashing the ‘<‘ ‘>’ signs, like
'\<iframe\>'If it doesn’t work use the html code instead:
>for ><for <So the only phrase would be something like:
or
Or better yet, create a javascript function that does what you need outside the html body code.