javascript - Call function depends on selected id from database -


i have javascript code.

<script>  $( "#show-id" ).click(function() {...} </script> 

i need id make dynamic mysql db. in php mysql.

$id = $row["id"]; 

i try found on google dont have lot of experience js. tried, has syntax error ...

make sure understand difference between server-side , client-side code. wild guess, little have posted, think you're passing variables between php , js.

<script> var div_id = <?php $row["id"] ?>; //im assuming youre getting $row['id'] correctly  var element = document.createelement("div"); element.id = "my_id"; element.innerhtml = div_id   $( "#" + element.id ).click(function() {...}  </script> 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -