Why this function javascript not alert? -


why function javascript not alert ?

first , click click 1 it's show delete , click delete

why not alert 111-aaaa how can that?

https://jsfiddle.net/tdpusq05/

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <div onclick="test_fn1()">click 1</div> <div id="demo"></div>  <script> function test_fn1() { document.getelementbyid("demo").innerhtml = "<span onclick='delete_fn('111-aaaa')'>delete</span>"; }; </script>  <script> function delete_fn(no_delete) {     alert(no_delete); }; </script> 

remove single quotes onclick around delete_fn('111-aaaa') following

function test_fn1() {     document.getelementbyid("demo").innerhtml = "<span onclick=delete_fn('111-aaaa')>delete</span>"; }; 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -