AmitDiwan has Published 10740 Articles

Convert DATE timestamp to return the month number

AmitDiwan

AmitDiwan

Updated on 02-Jan-2020 05:13:03

248 Views

To return only the month number, you can use DATE_FORMAT() -mysql> create table DemoTable1999    (    ArrivalDate timestamp    ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1999 values('2019-01-01 12:34:00'); Query OK, 1 row affected (0.18 sec) mysql> ... Read More

Setting Background Position using CSS

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 10:46:14

80 Views

Background position is to set the beginning position of a background image. For this, use the background-position property.ExampleLet us now see an example − Live Demo body {    background-image: url("https://www.tutorialspoint.com/images/Swift.png");    background-repeat: no-repeat;    background-attachment: fixed;    color: blue;    background-position: left center; } .demo {   ... Read More

jQuery Misc get() Method

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 09:33:09

159 Views

The get() method in jQuery is used to get the DOM elements matched by the selector.SyntaxThe syntax is as follows −$(selector).get(index)Above, the index specifies which of the matching elements to get.Let us now see an example to implement the jQuery get() method −Example Live Demo    $(document).ready(function(){   ... Read More

jQuery Misc each() Method

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 09:29:42

210 Views

The each() method in jQuery is used to execute a function for each matched element.SyntaxThe syntax is as follows −$(selector).each(function(index, ele))Above, the index is the position of the selector, whereas ele is the current element.Let us now see an example to implement the jQuery each() method −Example Live Demo ... Read More

jQuery length property

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 09:25:52

368 Views

The length property in jQuery is used to get the number of elements in the jQuery object.SyntaxThe syntax is as follows −$(selector).lengthExampleLet us now see an example to implement the jQuery length property − Live Demo    $(document).ready(function(){       $("button").click(function(){          document.getElementById("demo").innerHTML = ... Read More

jQuery Traversing Ancestors

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 09:23:39

300 Views

To traverse and find ancestors of an element, jQuery has the following methods: parent(), parents() and parentsUntil()−parent() methodThe parent() method in jQuery is used to return the direct parent element of the selected element. Let us see an example −Example Live Demo div {    width:600px; } .demo ... Read More

jQuery Misc toArray() Method

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 09:14:34

171 Views

The toArray() method in jQuery is used to get all the DOM elements contained in the jQuery set, as an arraySyntaxThe syntax is as follows −$(selector).toArray()Let us now see an example to implement the jQuery toArray() method −Example Live Demo    $(document).ready(function(){       $("button").click(function(){     ... Read More

jQuery is() Method

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 09:11:50

339 Views

The is() method in jQuery is used to check whether one of the selected elements matches the value in parameter selectorEle.SyntaxThe syntax is as follows −$(selector).is(selectorElement, func(index, element))Above, selectorEle is a selector expression, element or jQuery object to match with the current set of the element. The func parameter is ... Read More

jQuery removeProp() with Examples

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 08:18:43

240 Views

The removeProp() method in jQuery is used to remove a property set by the prop() method.SyntaxThe syntax is as follows −$(selector).removeProp(property)Above, the parameter property is the name of the property to remove.ExampleLet us now see an example to implement the jQuery removeProp() method − Live Demo    $(document).ready(function(){ ... Read More

jQuery data() with Examples

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 08:15:54

663 Views

The data() method in jQuery is used to attach data to or gets data from selected elements.SyntaxThe syntax is as follows −$(selector).data(name) $(selector).data(name, value)Above, the name is the name of data to retrieve for the 1st syntax.For the 2nd syntax, the name is the name of data to set, whereas ... Read More

Advertisements