This code demo you how can you store a value in '->'/or any special character  seperated and also how can you use in javascript like explode of php using split() of js .

 <?php

 for(i=1;i<=10;i++)
{
$all_surveyId.=$i.'->';
}
?>
<td onClick="cceremarks('cceremark','<?php echo $all_surveyId;?>')">remarks</td><script>
function cceremarks(id,all_surveyId )
{
var all_surveyId= all_surveyId.split('->');
for (var kk in all_surveyId)
{
if( (all_surveyId[kk] != "))
{
document.getElementById('menu_Report_'+all_surveyId[kk]).style.backgroundColor = '#d0e4f6';
}
}
document.getElementById('cceremark').style.display= ";
document.getElementById('menu_Remarks').style.backgroundColor = '#e8eef7';
document.getElementById('menu_PatientProfile').style.backgroundColor = '#d0e4f6';
document.getElementById('menu_Offers').style.backgroundColor = '#d0e4f6';
document.getElementById('menu_NextCall').style.backgroundColor = '#d0e4f6';
document.getElementById('menu_Vm').style.backgroundColor = '#d0e4f6';
document.getElementById('INDIANCALLL').style.display= 'none';
}
</script>

Share on Facebook