Category: Jquery & Javascript
How to make page scroll position to top at page refresh in HTML
$(document).ready(function(){ $(‘html’).animate({scrollTop:0}, 1); $(‘body’).animate({scrollTop:0}, 1); });... Read MoreSubmit a form using javascript
We can submit a form using its name, id, class and tag <form id=”form” name=”form1″ class=”form”> </form> Suppose forms name is “form1”, the... Read MoreUncaught TypeError: Cannot read property ‘className’ of null
This error occurs because we called a class or id that is not defined inside the body tag in html , or its div is not defined in a proper way. Actually div is not existed, there is no element html ele... Read Morelast element in an array using java script
arrayname.slice(-1)[0]; arrayname.slice(-1).pop();... Read MoreHow to check if element exists in the html page using javascript?
Suppose it is a div with id “slots” then in jquery: if( $(“#slots”).length < 1 ) { console.log(“Div is not present”); }else { console.log(“Div with id #slo... Read Moredisplay none using javascript
Either we can use show() and hide() functions for this: $(“#hide_id”).hide(); $(“#hide_id”).show(); Or using css in scripts: $(“#hide_id”).css(“display”... Read MoreObject Oriented Concept in javascrips?
Object oriented always used to refer about objects. Programming based on objects( actually a building block of javascript). All javascript components are objects. Eg: strings, functions etc… A s... Read MoreHow to declare an object in javascript?
How to declare classes in jaascript? Objects are building blocks of javasript. “Class” keyword not using in javascript. Its all about objects. Two methods are there: literal object. 1.var ... Read MoreObjects in javascripts?
Objects are building blocks of javasript. “Class” keyword not using in javascript. Its all about objects. All components in javascripts are objects, Strings, functions etc.. Loaded window ... Read More- 3 of 4
- « Previous
- 1
- 2
- 3
- 4
- Next »