All In One Script
MENU

How do I check if an element is hidden in jQuery?

by 12:26:00 AM
undefined
How do I check if an element is hidden in jQuery? It is possible to toggle the visibility of an element, using the functions .hide(), .show() or .toggle(). How would you test if an element is visible or hidden? Answer: Since the question refers to a single element, this code might be more suitable: // Checks for display:[none|block], ignores visible:[true|false] $(element).is(":visible"); Same as twernt's suggestion, but applied to a single element; and it matches the algorithm recommended in the jQuery FAQ http://stackoverflow.com/questions/178325/how-do-i-check-if-an-element-is-hidden-in-jquery

How to remove a property from a JavaScript object?

by 4:32:00 AM
undefined
How to remove a property from a JavaScript object? Say I create an object as follows: var myObject = { "ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*" }; What is the best way to remove the property regex to end up with new myObject as follows? var myObject = { "ircEvent": "PRIVMSG", "method": "newURI" }; Answer:  Like this: delete myObject.regex; // or, delete myObject['regex']; // or, var prop = "regex"; delete myObject[prop]; For anyone interested in reading more about it, Stack Overflow user kangax has written an incredibly in-depth blog post about

How do I check/uncheck a checkbox input or radio button?

by 9:10:00 PM
undefined
How do I check/uncheck a checkbox input or radio button? How do I check/uncheck a checkbox input or radio button? Just simple you use, check or uncheck a checkbox element or a radio button using the  .prop()   method: // Check #x $( "#x" ).prop( "checked", true ); // Uncheck #x $( "#x" ).prop( "checked", false ); source form : https://learn.jquery.com/using-jquery-core/faq/how-do-i-check-uncheck-a-checkbox-input-or-radio-button/

Window clearTimeout() Method

by 12:14:00 AM
undefined
Window clearTimeout() Method Definition and Usage The clearTimeout() method clears a timer set with the setTimeout() method. The ID value returned by setTimeout() is used as the parameter for the clearTimeout() method. var myVar; function myFunction() { myVar = setTimeout(function(){ alert("Hello"); }, 3000); } function myStopFunction() { clearTimeout(myVar); }

Instagram