Insert Element as Last Child Using jQuery

David Meador
Updated on 10-Dec-2019 07:06:22

5K+ Views

To insert element as a last child using jQuery, use the append() method. The append( content ) method appends content to the inside of every matched element.ExampleYou can try to run the following code to learn how to insert element as a last child using jQuery:Live Demo           jQuery Example                              var x = 0;          $(document).ready(function() {             $('.add').on('click', function (event) {         var html = "demo text " + x++ + "";         $("#parent-div").append(html);     });          });                          .div{             margin:10px;             padding:12px;             border:2px solid #F38B00;             width:60px;          }                                 Hello World                

Implement DELETE Query in MySQL Stored Procedure

AmitDiwan
Updated on 10-Dec-2019 07:06:10

2K+ Views

You can use stored procedure and can pass the value via parameter. Let us first create a table −mysql> create table DemoTable1464    -> (    -> Id int,    -> FirstName varchar(20)    -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1464 values(101, 'Chris Brown'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable1464 values(102, 'John Doe'); Query OK, 1 row affected (0.09 sec)Display all records from the table using select statement −mysql> select * from DemoTable1464;This will produce the following output −+------+-------------+ | Id ... Read More

Remove All Elements from the List in C#

AmitDiwan
Updated on 10-Dec-2019 07:05:10

174 Views

To remove all the elements from the List, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args) {       List list1 = new List();       list1.Add("One");       list1.Add("Two");       list1.Add("Three");       list1.Add("Four");       list1.Add("Five");       Console.WriteLine("Elements in List1...");       foreach (string res in list1) {          Console.WriteLine(res);       }       List list2 = new List();       list2.Add("India");       list2.Add("US");       ... Read More

Concatenate Multiple Rows and Columns in a Single Row with MySQL

AmitDiwan
Updated on 10-Dec-2019 07:02:27

1K+ Views

To concatenate multiple rows and columns in single row, you can use GROUP_CONCAT() along with CONCAT(). Let us first create a table −mysql> create table DemoTable1463    -> (    -> ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> ClientName varchar(20),    -> ClientAge int    -> ); Query OK, 0 rows affected (1.37 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1463(ClientName, ClientAge) values('Adam Smith', 34); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable1463(ClientName, ClientAge) values('John Doe', 29); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable1463(ClientName, ClientAge) values('David ... Read More

Perform Mathematical Calculations in MySQL with Null and Non-Null Values

AmitDiwan
Updated on 10-Dec-2019 07:00:25

278 Views

For this, you can use IFNULL() and perform mathematical calculations with NULL and NON-NULL values. Let us first create a table −mysql> create table DemoTable1462    -> (    -> Value1 int,    -> Value2 int    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1462 values(10, 20); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable1462 values(50, NULL); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable1462 values(NULL, 70); Query OK, 1 row affected (0.25 sec)Display all records from the table using select ... Read More

Get Number of Elements in Collection in C#

AmitDiwan
Updated on 10-Dec-2019 06:59:45

126 Views

To get the number of elements contained in Collection, the code is as follows −Example Live Demousing System; using System.Collections.ObjectModel; public class Demo {    public static void Main() {       Collection col = new Collection();       col.Add("Andy");       col.Add("Kevin");       col.Add("John");       col.Add("Kevin");       col.Add("Mary");       col.Add("Katie");       col.Add("Barry");       col.Add("Nathan");       col.Add("Mark");       Console.WriteLine("Count of elements = "+ col.Count);       Console.WriteLine("Iterating through the collection...");       var enumerator = col.GetEnumerator();       while ... Read More

Order By ENUM Type Value in MySQL Based on Conditions

AmitDiwan
Updated on 10-Dec-2019 06:56:49

514 Views

For this, use ORDER BY CASE statement. Let us first create a table, wherein we have ENUM type column −mysql> create table DemoTable1461    -> (    -> DeckOfCards ENUM('K', 'J', 'A', 'Q')    -> ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1461 values('K'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable1461 values('A'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable1461 values('J'); Query OK, 1 row affected (0.44 sec) mysql> insert into DemoTable1461 values('Q'); Query OK, 1 row affected (0.13 sec)Display all ... Read More

Using Real Boolean Type in SAP ABAP

Rahul Sharma
Updated on 10-Dec-2019 06:56:15

435 Views

This way is called as a Predictive Method call. This will work if the initial value is false and false is the initial value. You can refer to below link to know about Predictive method call and also to see examples:https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenpredicative_method_calls.htm

Get or Set Element at Specified Index in List in C#

AmitDiwan
Updated on 10-Dec-2019 06:55:43

163 Views

To get or set the element ate the specified index in the List, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args) {       List list = new List();       list.Add("100");       list.Add("200");       list.Add("300");       list.Add("400");       list.Add("500");       list.Add("600");       list.Add("700");       list.Add("800");       list.Add("900");       list.Add("1000");       Console.WriteLine("Element at index 0 = " + list[0]);       Console.WriteLine("Element at index 1 ... Read More

Fetch Column Size and Display Sum in MySQL

AmitDiwan
Updated on 10-Dec-2019 06:48:53

150 Views

Let us first create a table −mysql> create table DemoTable1612    -> (    -> FirstName varchar(20),    -> LastName varchar(20)    -> ); Query OK, 0 rows affected (0.87 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1612 values('David', 'Brown'); Query OK, 1 row affected (0.75 sec) mysql> insert into DemoTable1612 values('John', 'Smith'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable1612 values('Bob', 'Taylor'); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select * from DemoTable1612;This will produce the following output −+-----------+----------+ | FirstName | ... Read More

Advertisements