php - Javascript inside a Wordpress loop -


i trying run javascript inside wordpress loop , won't recognise php variables. want when 1 box clicked show hidden content when box or box clicked again should hide content.

$(document).ready(function(){     $("#show").on("click", function(e) {           var target = $(this).attr("href");         $(target).slidetoggle("fast");         $("<?php echo $name; ?>").not(target).hide();         e.preventdefault();     }); }); 

that inside foreach loop of each custom post type label. have advice? thanks.

maybe work you.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script> $(document).ready(function(){     $("#on").click(function(){         $("#area want hide/show").toggle();     });  }); </script> 

Comments

Post a Comment

Popular posts from this blog

filehandler - java open files not cleaned, even when the process is killed -

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -