JS and UI Design
JavaScript is often used to manipulate various aspects of the GUI in web applications; articles in this category are strictly focused on this manipulation.
- Should you use querySelector or getElementById?; querySelector is more flexible, and able to perform more complex selections.
- Easily check if an element is either hovered or in focus using plain JavaScript.
- The Width and Height of the browser Window can be obtained through the innerWidth and innerHeight properties; these can be checked by an event handler to detect resize events.
- You can either use a pure JavaScript solution, or you can choose to go with a library such as JQuery. Either way, this short tutorial show how it is done. Enjoy!
- To handle forms with JavaScript we may attach the preventDefault method to the submit event of the form, this allows us to handle the form data from our script instead.