+ 10
How to use JQuery code inside PHP code??? Is it Possible??
I want to perform some operations inside php code , But it's not working :( check this code: https://code.sololearn.com/w3THwOhU9fSn/#php for(;;) Thanks(":)");
6 Answers
+ 5
Toni Isotalo Yes You are right , :) but I have to use $ .. because its selector in jquery
https://www.sololearn.com/learn/jQuery/2790/
+ 5
its not working Toni Isotalo :( can you give me an example???
+ 5
Toni Isotalo It's not working ...:(. 😓😓
Have you check it??
+ 4
Use single quotes or otherwise php uses $ marks as variables
+ 4
Yes but wrap your output inside single quotes and $ marks are selectors and not variables ’’
+ 3
Use this jquery link
https://code.jquery.com/jquery-3.3.1.min.js
You were also missing few brackets at the end
echo '<script>$(document).ready(function(){$("p").click(function(){$(this).hide();});});</script>';