hello I'm not good at JS and JQuery I have a quick question My fuction is function achele(kodu) { var htmla = 'What is your name?' + kodu + ' is your name ?'; $('#mydiv').html(htmla); } Code (markup): my question is how can I call this function? I use this but it doesn't work :/ <script> achele('john'); </script> <div id="mydiv"></div> Code (markup): p.s. I have to use 'mydiv' id
<html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script> function achele(kodu) { var htmla = 'What is your name? Is your name ' + kodu + ' ?'; $('#mydiv').html(htmla); } $(document).ready(function() { achele('john'); }); </script> </head> <body> <div id="mydiv"></div> </body> </html> HTML: