I want to highlight that portion of a mapped image whose id is retrieved from mysql database. I have stored the id in $loc variable. Now using jquery selectors I want to pass this php variable in my jquery selector so that it will highlight the portion of image having the same id as in $loc. Here is my working code:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.maphilight.js"></script>
<script type="text/javascript">
$(function () {
$(".mapping").maphilight();
$(".hoverable").css("border", "3px solid red");
var data = $('#cr2').data('maphilight') || {};
data.alwaysOn = !data.alwaysOn;
$('#cr1').data('maphilight', data).trigger('alwaysOn.maphilight'); // portion to always highlight (I WANT TO PASS THE PHP VARIABLE $LOC INSTEAD OF '#CR1'
});<area shape="poly" id="cr1" class="room" coords="549,272,489,334,534,377,594,316" href="www.msn.com" target="_top" alt="CR1" name="room-1">
$('#cr1')to be$('#<?php echo $loc; ?>')?