Implement the method of adding and assigning tag sub-elements in jQuery

亚连
Release: 2018-06-04 17:12:30
Original
2696 people have browsed it

Below I will share with you a jQuery method for adding and assigning tag sub-elements. It has a good reference value and I hope it will be helpful to everyone.

1. Define the

Copy after login2. Write js Statement:Copy after login3. Write the corresponding request statement:List deptList=null; @RequestMapping(value = "/getDepts",method = {RequestMethod.GET}) public void getDepts(HttpServletResponse response) throws IOException { response.setCharacterEncoding("utf-8"); response.setContentType("text/json;charset=utf-8"); if (deptList == null){ deptList = deptService.findAllDepts(); }else { String res=JSON.toJSONString(deptList); response.getWriter().write(res); } }Copy after login4. The implementation effect is as follows:The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.Related articles:How to use ngrok express to solve WeChat interface debugging problemsHow to use element-ui tables to make cells editableHow to clear the verification after closing the dialog in element uiThe above is the detailed content of Implement the method of adding and assigning tag sub-elements in jQuery. For more information, please follow other related articles on the PHP Chinese website!Related labels:jqueryelementAdd tosource:php.cnPrevious article:How to change P tag text value in jQueryNext article:By creating tags in js dynamics and setting attribute methods (detailed tutorial)Statement of this WebsiteThe content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cnLatest Articles by AuthorProblems with pop-up windows not being centered in weebox2018-06-23 18:19:43How to use excel-like components in vue+canvas2018-06-23 18:17:39How to call class in JavaScript2018-06-23 18:11:37How to implement pull-up refresh function using Vue framework2018-06-23 18:10:14How to implement image cropping component using Vue mobile terminal2018-06-23 18:06:43About WeChat mini program templates and modular usage (detailed tutorial)2018-06-23 18:04:28How to implement pull-up loading function in vue22018-06-23 18:02:45How to implement three-level linkage using Vue22018-06-23 18:00:45How to implement data request display loading graph in vue22018-06-23 17:58:23How to set up and monitor using element full screen2018-06-23 17:56:41Latest IssuesSteps to install jQuery in Nuxt.jsAlthough I try to add jQuery in my project, I get an error saying it's not defined. plugin...From 2023-11-06 16:41:5001225jQuery getting wrong value when getting data attributeI have a div with data attribute
I have...From 2023-11-01 23:01:1901209Support jQuery's Transfer-Encoding:chunkedI'm a web developer. In my script I use header() to set "Transfer-Encoding:chunked&qu...From 2023-10-25 23:44:3701230How to get the natural dimensions of an image using JavaScript or jQuery?So far I have this code: varimg=document.getElementById('draggable'); varwidth=img.clientW...From 2023-10-21 13:53:0802275Automatically expand text areaI'm trying to make a simple auto-expanding text area. This is my code: textarea.onkeyup=fu...From 2023-10-21 08:49:2302225Related TopicsMore>What are the jquery plug-ins?How to find the maximum and minimum value of array elements in JavaHow to operate json with jqueryHow to delete elements in jqueryUse of jQuery hover() methodjquery implements paging methodWhat is a hidden element in jqueryWhat is highlighting in jqueryPopular Recommendationswhat does js meanHow to convert string to array in js?How to refresh the page using javascriptHow to delete an item in js arrayHow to use sqrt functionPopular TutorialsMore>Related TutorialsPopular RecommendationsLatest coursesThe latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)1398122PHP introductory tutorial one: Learn PHP in one week4212470JAVA Beginner's Video Tutorial2376633Little Turtle's zero-based introduction to learning Python video tutorial495081PHP zero-based introductory tutorial829171The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)1398122 times of learningJAVA Beginner's Video Tutorial2376633 times of learningLittle Turtle's zero-based introduction to learning Python video tutorial495081 times of learningQuick introduction to web front-end development213764 times of learningMaster PS video tutorials from scratch848635 times of learning[Web front-end] Node.js quick start3733 times of learningComplete collection of foreign web development full-stack courses2872 times of learningGo language practical GraphQL2356 times of learning550W fan master learns JavaScript from scratch step by step497 times of learningPython master Mosh, a beginner with zero basic knowledge can get started in 6 hours12893 times of learningLatest DownloadsMore>Web EffectsWebsite Source CodeWebsite MaterialsFront End Template[form button] jQuery enterprise message form contact code[Player special effects] HTML5 MP3 music box playback effects[Menu navigation] HTML5 cool particle animation navigation menu special effects[form button] jQuery visual form drag and drop editing code[Player special effects] VUE.JS imitation Kugou music player code[html5 special effects] Classic html5 pushing box game[Picture special effects] jQuery scrolling to add or reduce image effects[Photo album effects] CSS3 personal album cover hover zoom effect[Front-end template] Home Decor Cleaning and Repair Service Company Website Template[Front-end template] Fresh color personal resume guide page template[Front-end template] Designer Creative Job Resume Web Template[Front-end template] Modern engineering construction company website template[Front-end template] Responsive HTML5 template for educational service institutions[Front-end template] Online e-book store mall website template[Front-end template] IT technology solves Internet company website template[Front-end template] Purple style foreign exchange trading service website template[PNG material] Cute summer elements vector material (EPS PNG)[PNG material] Four red 2023 graduation badges vector material (AI EPS PNG)[banner picture] Singing bird and cart filled with flowers design spring banner vector material (AI EPS)[PNG material] Golden graduation cap vector material (EPS PNG)[PNG material] Black and white style mountain icon vector material (EPS PNG)[PNG material] Superhero silhouette vector material (EPS PNG) with different color cloaks and different poses[banner picture] Flat style Arbor Day banner vector material (AI+EPS)[PNG material] Nine comic-style exploding chat bubbles vector material (EPS+PNG)[Front-end template] Home Decor Cleaning and Repair Service Company Website Template[Front-end template] Fresh color personal resume guide page template[Front-end template] Designer Creative Job Resume Web Template[Front-end template] Modern engineering construction company website template[Front-end template] Responsive HTML5 template for educational service institutions[Front-end template] Online e-book store mall website template[Front-end template] IT technology solves Internet company website template[Front-end template] Purple style foreign exchange trading service website templateAbout usDisclaimerSitemapphp.cn:Public welfare online PHP training,Help PHP learners grow quickly!