this is the original code of the script
var $mainCat=$('#main_cat').val();
and i replaced it with this
var $mainCat=$('#<how to pass the slug here>').val();
echo '<ul>';
foreach ($termchildren as $child) {
$term = get_term_by( 'id', $child, $taxonomyName );
echo '<li><a href="#" id=' .$term->slug. '>' . $term->name . ' </a></li>';
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript">
$(function()
{
$('a#<?php echo $term->slug; ?>').click(function()
{
$('#pop-up1').show();
$('#pop-up').show();
<?php echo $term->slug; ?>
var $mainCat=$('#<how to pass the slug here>').val();
now i need to pass the " a href " value i,e. term->slug to the variable $mainCat. How can i do it, kindly help me
wp_enqueue_script()– Stephen Harris Nov 21 '12 at 12:11