0
$status="<div  class='analysis btn btn-secondary' ><a id='$poupid' href='javascript: void 0;' onclick='open_windowdata(this.href,this.id)' style='color:white'><strong>Not attempted</strong></a></div>";

just need to replace onclick with below code

onclick="$('#wiewans_<?php echo $slno; ?>').slideToggle('slow')"

facing with trouble quote any one help us thanks

8
  • What is your expected $status? Commented Aug 15, 2018 at 14:20
  • what have you tried so far? Commented Aug 15, 2018 at 14:20
  • @ankit onclick='open_windowdata(this.href,this.id)' need to replace onclick="$('#wiewans_<?php echo $slno; ?>').slideToggle('slow')" Commented Aug 15, 2018 at 14:21
  • @Gajendra use backquote to surround the entire text. Commented Aug 15, 2018 at 14:23
  • you need to escape the double quotes like so onclick=\"open_...slow')\" ... Commented Aug 15, 2018 at 14:24

1 Answer 1

1

Escape the double quotes with ' \ ', this way they wont get parsed as end of the string :

$status = "<div class='analysis btn btn-secondary'><a id='$poupid' href='javascript: void 0;' onclick=\"$('#wiewans_<?php echo $slno; ?>').slideToggle('slow');\" style='color:white'><strong>Not attempted</strong></a></div>";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.