Home >Web Front-end >JS Tutorial >jQuery implements div display, hiding and text filling
When using native JavaScript programming, we found that it has many shortcomings: for example, it is inconvenient to obtain elements, and sometimes it is necessary to traverse. There may be nesting in the traversal, which makes the code more cumbersome and has poor tolerance. Today I will lead you to use jQuery to implement your first web page.
(1) Use HTML layout page
1) Create project Pro_01, create a web page under the project, name it index.html;
2) In the HTML page Add three buttons;
<input type="button" value="显示" id="show" /> <input type="button" value="隐藏" id="hide" /> <input type="button" value="内容填充" id="text"/>
3) Add three DIV tags to the HTML page;
<div></div> <div></div> <div></div>
(2) Use CSS to beautify the page
1) Create under this project css folder;
2) Create a css file, name it style.css, and import the file before the
The above is the detailed content of jQuery implements div display, hiding and text filling. For more information, please follow other related articles on the PHP Chinese website!