20151116142938841.png (639×572)

Access, create, modify, and delete DOM nodes in JavaScript_Basic knowledge

DOM DOM is the abbreviation of Document object Model. The document object model is a document that expresses XML or HTML in the form of tree nodes. Using DOM methods and properties, you can access, modify, delete any element on the page, and you can also add an element. DOM is a language-independent API that can be implemented in any language, including Javascript Take a look at one of the texts below. first paragraph second paragraph final Let’s take a look at the second paragraph second paragraph You can see that this is a p tag. It is included in the body tag. So body is the parent node of p, and p is the child node. The first and third paragraphs are also child nodes of the body. They are all sibling nodes of the second paragraph. This em tag is a child node of the second segment p. Therefore p is its parent node. The parent-child node relationship can depict a tree-like relationship. So it’s called DOM tree. Core DOM and HTML DOM We already know that DOM can depict HTML and XML documents. In fact, an HTML document is an XML document, but more standardized. Therefore, as…

20151116142938841.png (639×572)

Access, create, modify, and delete DOM nodes in JavaScript_Basic knowledge

DOM DOM is the abbreviation of Document object Model. The document object model is a document that expresses XML or HTML in the form of tree nodes. Using DOM methods and properties, you can access, modify, delete any element on the page, and you can also add an element. DOM is a language-independent API that can be implemented in any language, including Javascript Take a look at one of the texts below. first paragraph second paragraph final Let’s take a look at the second paragraph second paragraph You can see that this is a p tag. It is included in the body tag. So body is the parent node of p, and p is the child node. The first and third paragraphs are also child nodes of the body. They are all sibling nodes of the second paragraph. This em tag is a child node of the second segment p. Therefore p is its parent node. The parent-child node relationship can depict a tree-like relationship. So it’s called DOM tree. Core DOM and HTML DOM We already know that DOM can depict HTML and XML documents. In fact, an HTML document is an XML document, but more standardized. Therefore, as…

A complete list of Javascript select control operations (add, modify, delete, select, clear, determine existence, etc.)_Form special effects

1 Determine whether there is an Item with Value=”paraValue” in the select option 2 Add an Item to the select option 3 Delete an Item from the select option 4 Delete the selected item in the select 5 Modify the text of value=”paraValue” in the select option to “paraText” 6 Set the first Item of text=”paraText” in the select to be selected7 Set the Item of value=”paraValue” in the select to be selected 8 Get the value of the currently selected item of select 9 Get the text of the currently selected item of select 10 Get the Index of the currently selected item of select 11 Clear the item of selectjs code// 1. Determine whether there is an Item with Value=”paraValue” in the select option function jsSelectIsExitItem(objSelect, objItemValue) { var isExit = false; for (var i = 0; i < objSelect.options.length; i++) { if (objSelect.options[i].value == objItemValue) { isExit = true; break; } } return isExit; } // 2. Add an Item to the select option function jsAddItemToSelect(objSelect, objItemText, objItemValue) { //Determine whether it existsif (jsSelectIsExitItem(objSelect , objItemValue)) { alert(“The Value of this Item already exists”); } else { var varItem = new Option(objItemText, objItemValue); objSelect.options.add( varItem); alert(“Successfully added”);…

javascriptXml add, delete, modify, check (under IE) operation implementation code

html file: The code is as follows: Xml file: Code As follows: tree male

A complete collection of Javascript operation select methods [add, modify, delete, select, clear, determine existence, etc.]

js code// 1. Determine whether there is an Item with Value=”paraValue” in the select option function jsSelectIsExitItem(objSelect, objItemValue) { var isExit = false; for (var i = 0; i <objSelect.options.length; i++) { if (objSelect.options[i].value == objItemValue) { isExit = true; break; } } return isExit; } // 2. Add an Item to the select option function jsAddItemToSelect(objSelect, objItemText , objItemValue) { //Determine whether it existsif (jsSelectIsExitItem(objSelect, objItemValue)) { alert(“The Value of this Item already exists”); } else { var varItem = new Option(objItemText, objItemValue); objSelect.options.add(varItem); alert(“Successfully added”); } } // 3. Delete an Item from the select option function jsRemoveItemFromSelect(objSelect, objItemValue) { //Determine whether it existsif (jsSelectIsExitItem(objSelect, objItemValue)) { for (var i = 0; i <objSelect.options.length; i++) { if (objSelect.options[i].value == objItemValue) { objSelect.options.remove(i); break; } } alert(“Deleted successfully”); } else { alert(“This item does not exist in the selection”); } } // 4. Delete the selected item in selectfunction jsRemoveSelectedItemFromSelect(objSelect) { var length = objSelect.options.length – 1; for(var i = length; i >= 0; i–){ if(objSelect[i].selected == true){ objSelect.options[i] = null; } } } // 5. Modify the text of value=”paraValue” in the select option to “paraText” function jsUpdateItemToSelect( objSelect, objItemText, objItemValue) { //Determine whether it existsif (jsSelectIsExitItem(objSelect, objItemValue))…

A complete list of Javascript select control operations (add, modify, delete, select, clear, determine existence, etc.)

1 Determine whether there is an Item with Value=”paraValue” in the select option 2 Add an Item to the select option 3 Delete an Item from the select option 4 Delete the selected item in the select 5 Modify the text of value=”paraValue” in the select option to “paraText” 6 Set the first Item of text=”paraText” in the select to be selected7 Set the Item of value=”paraValue” in the select to be selected 8 Get the value of the currently selected item of select 9 Get the text of the currently selected item of select 10 Get the Index of the currently selected item of select 11 Clear the item of selectjs code// 1. Determine whether there is an Item with Value=”paraValue” in the select option function jsSelectIsExitItem(objSelect, objItemValue) { var isExit = false; for (var i = 0; i < objSelect.options.length; i++) { if (objSelect.options[i].value == objItemValue) { isExit = true; break; } } return isExit; } // 2. Add an Item to the select option function jsAddItemToSelect(objSelect, objItemText, objItemValue) { //Determine whether it existsif (jsSelectIsExitItem(objSelect , objItemValue)) { alert(“The Value of this Item already exists”); } else { var varItem = new Option(objItemText, objItemValue); objSelect.options.add( varItem); alert(“Successfully added”);…

Add, delete, modify, and check arrays of JavaScript study notes

The importance of arrays in programming languages ​​is self-evident. Arrays in Javascript are also one of the most commonly used objects. Arrays are ordered collections of values. Due to weak types, arrays in Javascript are very flexible and powerful. Unlike arrays in strongly typed high-level languages ​​such as Java, which can only store elements of the same type or its subtypes, Javascript can store multiple types of elements in the same array, and the length can also be dynamically adjusted, as the data increases or Reduce automatic changes to array length. Array is a common object in Javascript. It has some classic operations, such as adding, deleting, modifying and searching the array. This article mainly summarizes the relevant operation methods in this regard. Add array items First, let’s look at how to add array items to an array. Suppose there is an array: var arr = []; An array is declared above, but this array is an empty array [] with a length value of 0. Next we look at how to add array items to the array arr. The simplest way is to add array items to the array through index values: var arr = []; arr[0] = ‘a’;…

Insert image description here

Java operates MySQL, creates JDBC tool classes, uses Druid connection pool technology, and implements CRUD (add, delete, modify, query)

Requirements:Use JDBC to create a table,Table name student,field contains id,name(username), class(class_and_grade) student number(student_number), gender(sex), Age, email address. And add corresponding constraints. Implement CRUD for the table (note the use of additions, deletions and modifications. 1. Create a module named JDBC 2. Add the resource druid.proporties 3. Connect to the MySQL database 4. Configure JDBC tool class package com.cn.zpark.utils; import java.sql.*; public class JDBCUtils { // Define data path connection information private static String url = “jdbc:mysql://localhost: 3306/my_druid?useSSL=false&serverTimezone=UTC&characterEncoding=UTF-8”; private static String user = “root”; private static String pwd = “ root”; public static Connection getConn() throws Exception {//Register the driver Class.forName(“com.mysql.jdbc.Driver”);//Return the connection object return DriverManager.getConnection (url, user, pwd);}public static void close(Connection conn, ResultSet res, Statement… stat){try {if(res != null){res.close();} for (Statement statement : stat) {if(statement != null){statement.close();}}assert conn != null;conn.close();} catch (SQLException e) {e .printStackTrace();}} } 5. Start creating table student Code: package com.cn.zpark; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java .sql.Statement; public class JDBCCreateTable { public static void main(String[] args) { // Define connection database information String url &#61 ; “jdbc:mysql://localhost:3306/my_druid?useSSL=false&serverTimezone=UTC&characterEncoding=UTF-8”; String user = “root”; String pwd = “root”; Connection conn = null; Statement stat = null; try {// 1. Register Driver Class.forName(“com.mysql.jdbc.Driver”); // 2. Get the connection…

Java development learning (41) MyBatisPlus standard data layer (add, delete, check, modify, paging) development

1. Standard CRUD usage What are the standard CRUD functions and what methods does MyBatisPlus provide to use them? Let’s take a look at the picture first: p> 1.1 Environment preparation The environment used here is the environment used in Java Development Learning (Forty) – MyBatisPlus Getting Started Cases and Introduction 2. New addition In Before adding new ones, we can analyze the new methods: int insert (T t) T: Generic, added to save new data int: Return value, 1 is returned after the addition is successful, 0 is returned if the addition is not successful Perform new operations in the test class: @SpringBootTestclass Mybatisplus01QuickstartApplicationTests {​ @Autowiredprivate UserDao userDao;​@Testvoid testSave() {User user = new User();user.setName(“Dark Horse Programmer”);user.setPassword(“itheima”);user.setAge(12); user.setTel(“4006184000”);userDao.insert(user);}} After executing the test, a piece of data will be added to the database table. But the primary key in the data ID is a bit long, so where does this primary key ID come from? What we want more is for the primary key to auto-increment, which should be 5. This is the primary key ID generation strategy we will introduce later. For this issue, we will temporarily Let it go first. 3. Delete Before deleting, we can analyze the deletion…

listcode.cn-full platform addition, deletion, modification and checking  Code generator, java, python, php, nodejs can all generate

listcode.cn is a full-platform add, delete, modify, and check code generator that can be generated by java, python, php, and nodejs.

What is listcode listcode.cn is essentially a code-generated cloud service website.Mainly provided CRUD code generation services for common languages ​​and frameworks such as java, python, php, nodejs (i.e. common additions, deletions, modifications and checks), back-end code, front-end interface, js, etc., one-stop solution.Specific supported languages ​​and technical frameworks: java, springmvc jpa mybatis php: laravel, thinkPhp5 python: flask, tonardo nodejs: vue, react, angular Look at a demo generated using listcode.cn What are the characteristics Supports page turning: you can set the size of a single page. [Mark 1 in Figure 1, Mark 1 in Figure 3] Support complex queries: joint queries with multiple conditions, each condition can be set with a prefix, such as greater than a certain value, like a certain value. [Mark 1 in Figure 2, Mark 3 in Figure 3] Perfect display and editing of foreign key tables: for tables referenced by foreign keys, a string type field is intelligently selected as a representative; a query window pops up during entry, making entry more user-friendly. [Figures 1, 2, and 3 are marked with 2, Figures 4 and 5 are marked with 1] Specific types of specific displays: date type, switch type, enumeration type, which will be continuously improved in…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索