I am trying to fade in div elements but for some reason every time I preview my script code it just displays it and doesn't run it
my script code is -
<script>
$("#t<?php echo $pNumber ?>").click(function() {
$("#b.<?php echo $pNumber ?>").fadeToggle("slow", "linear");
});
</script>
the PHP variable is used for changing div id's would this be causing a problem?
Thanks,
UPDATE -
example html this is for one of the div's (the id is incremented)
<div id="t1">Carl Froch 'fitter than ever' for Andre Ward Showtime Super Six fight</div>
<div id="b1"><p>Carl Froch gives Andre Ward seven years but no encouragement to believe their fight on Saturday night is a war of the ages.</p><p>The 34-year-old WBC champion from Nottingham rarely strays far from the 12-stone limit of his division and is hard o...<p><a href=http://www.guardian.co.uk/sport/2011/dec/14/carl-froch-andre- ward-showtime-super-six>Click here for full article</a></p> </div <script>
$("#t1").click(function() {
$("#b1").fadeToggle("slow", "linear");
});
</script>
JB