Hot to set an element’s CSS style using Javascript

Hot to set an element’s CSS style using Javascript

CSS is a great way to reduce the amount of markup that needs to be on a page. It also standardizes how your pages look and feel and should make it easier and quicker to add new content. But what happens if you have Javascript logic on your page and based off some user action, you want to change the appearance of an object? With Javascript, you can reference the object, then set the style equal to your desired new value. You can even change the...

Read More

Javascript Minification

Javascript is an interpreted language, meaning it’s not pre-compiled.  This has a few drawbacks, like keeping coding logic secret, but it’s good for quick changes and building scripts on the fly using another language.  Compiling is meant to speed up execution.  There is something you can do to speed up execution.  It’s called minification.  It does nothing but make your existing script take up the least amount of space...

Read More

Clicking and checking checkboxes using Javascript

Checkboxes are great tools for users because they allow for quick interaction with a form or page. Unlike dropdowns there’s only 1 click to get the desired result instead of 3. Also, for tablets, slates, smartphones and people with poor resolution monitors, checkboxes function alot easier than dropdowns that may require alot of scrolling. Sometimes you may want to alter or check the state of whether checkboxes are checked already on your...

Read More

Using an onchange event in javascript

Often times it’s nice to do things when users change the selection in a dropdown list. Maybe you want to hide certain options, or do a quick calculation for them. Here’s how to launch a function when the selection is changed. Of course if you want the text of what they selected, just use “text” instead of “value”.

Read More

NPI Luhn Check Digit Calculation

If you need to make up a fake NPI, you can’t just throw any 10 digits together and have it wind up as a valid NPI. NPI for those who don’t know is National Provider Identifier. You probably know that if you’re looking for a way to generate them though. The first digit has to be one or two and the last digit is actually a check digit of the rest of the digits plus a prefix that’s applied to the NPI to make a different...

Read More