I don't know does the code " console.log('hello') " whether means make a object(console) do sth.?
2.How to use the jQuery
<head> <!-- to use jQuery we need to import it like this --> <script src=" http://code.jquery.com/jquery-1.11.3.min.js"></script> </head> <body> <!-- in this example use use jQuery to change the content itself. The $ is shorthand for the jQuery function We are passing in a CSS selector which gets this element by its id. The html function sets the html content of an element --> <h1 id="title" οnclick="$('#title').html('Goodbye');"> Hello </h1> </body>
3.How to define a function in javaScript
<head> <script src = "http://code.jquery.com/jquery-1.11.3.min.js"></script> </head> <body> <h1 id="title" οnclick="sayHello()"> Hello </h1> </body> <!-- the script tag is where you can put more complex scripts --> <script type="text/javascript"> function sayHello() { alert('Hello'); }; </script>
转载于:https://www.cnblogs.com/BJTUzhengli/p/5166278.html