+ 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(":)");

9th Jun 2018, 1:08 PM
ㅤ Tweetu 😆 ㅤㅤ
ㅤ  Tweetu 😆 ㅤㅤ - avatar
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/
9th Jun 2018, 1:31 PM
ㅤ Tweetu 😆 ㅤㅤ
ㅤ  Tweetu 😆 ㅤㅤ - avatar
+ 5
its not working Toni Isotalo :( can you give me an example???
9th Jun 2018, 1:52 PM
ㅤ Tweetu 😆 ㅤㅤ
ㅤ  Tweetu 😆 ㅤㅤ - avatar
+ 5
Toni Isotalo It's not working ...:(. 😓😓 Have you check it??
9th Jun 2018, 2:32 PM
ㅤ Tweetu 😆 ㅤㅤ
ㅤ  Tweetu 😆 ㅤㅤ - avatar
+ 4
Use single quotes or otherwise php uses $ marks as variables
9th Jun 2018, 1:23 PM
Toni Isotalo
Toni Isotalo - avatar
+ 4
Yes but wrap your output inside single quotes and $ marks are selectors and not variables ’’
9th Jun 2018, 1:33 PM
Toni Isotalo
Toni Isotalo - avatar
+ 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>';
9th Jun 2018, 2:44 PM
Toni Isotalo
Toni Isotalo - avatar