So I have this line of code in a php file:
echo "<a class='button' onclick=report('$row[id]')></a>";
I'd like to add an id to the line, so I tried this:
echo "<a class='button' id='"report".$row[id]' onclick=changeColor('$row[id]')></a>";
and in my javascript file
document.getElementById('report'+id).style.color('blue');
but I keep getting errors in javascript
cannot read property 'style' of null,
because I'm doing something wrong with the concatenation. I'm trying to get the id to be something like "report100" by concatenating it with $row[id] and then in the javascript file, change it's font color. I've tried other variations, but I just seem to get it right.