javascript

{title ? title : null}

Set default option for select menus in Angular 2+

4/1/2018

I recently needed to add a `please select` default option for <select> menus with a null value. There is a lot of confusing information out there for what should be a simple task, so here […]

{title ? title : null}

Widths and Heights in Javascript

10/7/2016

Widths and heights can be a bit of a minefield in JavaScript and jQuery here is brief overview: Heights Object Code Type Description document.body.clientHeight JavaScript Inner height of the HTML document body, including padding but […]

{title ? title : null}

If element exists jQuery

5/1/2013

If you need to test whether an element exists n jQuery using a selector? I have found this little snippet of code very handy so thought I would share how it’s done here. Just replace […]

{title ? title : null}

Disable CSS stylesheet with JavaScript

4/1/2013

Use the following code to disable a style sheet using jQuery. [js] var styleSheets = document.styleSheets; var href = ‘http://www.website.com/css/style.css’; for (var i = 0; i < styleSheets.length; i++) { if (styleSheets[i].href == href) { […]