javascript - Error in for loop in JS inside stylesheet file -
i have xsl
file , there html
part of writing javascript
function inside
<script type="text/javascript" language="javascript" > function toggle_tbody(obj) { var body = document.getelementsbytagname("tbody"); if( obj.innertext == 'expand all' ) { obj.innertext = 'collapse all'; d = 'inline'; } else { obj.innertext = 'expand all'; d = 'none'; } var length = body.length for(var = 0; < length; i++) { document.getelementbyid("demo").innerhtml = length; } } </script>
but have error while compiling says:
xml parsing error @ line 164: starttag: invalid element name
i should mention line 164 beginning of loop.
would let me know error because see there shouldn't any.
thanks @rohankumar hint.
then here found should as
<script type="text/javascript" language="javascript" > function toggle_tbody(obj) { var body = document.getelementsbytagname("tbody"); if( obj.innertext == 'expand all' ) { obj.innertext = 'collapse all'; d = 'inline'; } else { obj.innertext = 'expand all'; d = 'none'; } //<![cdata[ var length = body.length for(var = 0; < length; i++) { document.getelementbyid("demo").innerhtml = length; } //]]> } </script>
Comments
Post a Comment