相互转换

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jQuery对象和DOM操作</title> <script src="js/jquery-3.3.1.js"></script> </head> <body> </body> <script type="text/javascript"> $(document).ready(function () { //MOD对象转换为jquery对象 var box=document.getElementById("box"); var j_obj=$(box); //obj.hide(),jquery的隐藏方法,对应show()方法 //obj.text(),jquery设置元素的值 //jquery对象转换为MOD对象 //方法一 $("button")[0] //方法二 $("button").get(0) }) </script> </html>