user6779766 user6779766 - 2 months ago 8
jQuery Question

JQuery function not working properly due to some missing script?

A simple slide up /slide down script isn't working well.

<div>
<small><p><?php echo $row2["date"]; ?></p></small>
<p name="answ"><B><big><font color= #ba4a00> A:</font></B></big> <small><?php echo $row2["answer"]; ?></small></br></p>
</div>

<script type='text/javascript'
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jqu‌​ery.min.js">
</script>
<script>
$(document).ready(function(){

$(".btn1").click(function(){
$('.answ').slideUp();
});
$(".btn2").click(function(){
$('.answ').slideDown();
});
});
</script>


Any suggestions will be appreciated..

Answer
$('[name="answ"]').doStuff();

Try this method.

Comments