jQuery

jquery การส่งค่าแบบ ajax

<!DOCTYPE html> <html> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js”> </script> <script> $(document).ready(function() { <!– Event — > $(“#ok1”).click(function() { <!– Action –> $.ajax ({ method: “POST”, url: “how2devajax.php”, data: { “var_1” : $(‘#p1’).val(), “var_2” : $(‘.text’).val() }, success: function(result) { $(‘#return_tag_id1’).val(result.return_var1); $(‘#return_tag_id2’).val(result.return_var2); }…
Read more

jquery: แสดง output

<!DOCTYPE html> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js”> </script> <script> $(document).ready(function() { <!– Event — > $(“#ok1”).mouseenter(function() { <!– Action –> $(“#output”).text(“Mouse In”); }); <!– Event 2 –> $(“#ok1”).mouseleave(function() { <!– Action — > $(“#output”).html(“<h1>Mouse Out</h1>”); }); }); </script> </head> <body> <button id=ok1>HOW2DEV.NET</button>…
Read more

jquery เริ่มต้น

<!DOCTYPE html> <html> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js”> </script> <script> $(document).ready(function() { <!– Event — > $(“#ok1”).click(function() { <!– Action –> $(“#p1”).hide(); <!– อ้างอิงถึง ID –> $(“p”).hide(); <!– อ้างอิงถึง Element tag p –> $(“.text”).hide() <!– อ้างถึง class –> }); <!– Event 2…
Read more