Do i need a hashtag in Javascript to pass as a Div
- by Mike
How do i insert this php DivSomething into Javascript? Since Javascript needs a hashtag to recognize that as a div. Is there a way to tell JS that this is a Div or there's other better way to do it? Any help would be very much appreciated.
<script>
/*How do i insert a var DivSomething into JS with a hashtag */
/* DivSomething is php dynamic. It returns a Div. It can be #Div1, #Div2, #Div3... */
var DivSomething = '<?php echo $Highlight; ?>'
$(function() {
$('#MouseHere').hover(function() {
$('#' + DivSomething).css('background-color', '#ffffff');
}, function() {
// on mouseout, reset the background colour
$('#' + DivSomething).css('background-color', '');
</script>