I have this print statement:
print "<a href='#' onClick='document.getElementById(\"myheader\").innerHTML=\"\"'".$rowQuery['keyword']." · </a>";
Unfortunately, it prints:
<a · ="" keyword ="" onclick="document.getElementById("myheader").innerHTML=""" href="#"/>
I have no idea why, any help would be useful. Because of the way it is printed, I can’t see anything on the screen and the functionality does not work either.
Note ($rowQuery[‘keyword’] = “keyword” in this case so it is being evaluated, that is not the problem. The problem is that it prints it weird)
(When I use HTML instead of php to print it using this line:
<a href="#" onClick="document.getElementById('myheader').innerHTML=''">ALL</a>
it works completely fine)
I think you are missing the closure of the
<a...tagYou have:
<a href=... some description</a>Instead of
<a href=... >some description</a>Try something like this (not sure I got the location of the ‘>‘ correct:
print "<a href='#' onClick='document.getElementById(\"myheader\").innerHTML=\"\"'".$rowQuery['keyword']">." · </a>";