Explain Codes LogoExplain Codes Logo

Javascript

How to call multiple JavaScript functions in an onclick event?

javascript
event-handling
unobtrusive-javascript
code-readability

Check if a div does NOT exist with javascript

javascript
conditional-logic
error-handling
dom-queries

How do I toggle an ng-show in AngularJS based on a boolean?

javascript
angularjs
ng-click
scope-properties

Smart way to truncate long strings

javascript
string-manipulation
javascript-utilities
best-practices

How to add new <li> to <ul> onclick with javascript

javascript
event-listeners
dom-manipulation
javascript-best-practices

Disabling tab focus on form elements

javascript
focus-control
accessibility
javascript-events

Smooth scroll without the use of jQuery

javascript
smooth-scroll
scrollintoview
window-scrollto

How do I set/unset a cookie with jQuery?

javascript
cookie-handling
jquery
javascript-api

How can I find the closest previous sibling with class using jQuery?

javascript
performance
dom-traversal
best-practices

Adding additional data to select options using jQuery

javascript
prompt-engineering
browser-compatibility
performance-optimization

Is cross-origin postMessage broken in IE10?

javascript
prompt-engineering
message-channel
cross-origin

How to make an ng-click event conditional?

javascript
prompt-engineering
best-practices
usability

React - changing an uncontrolled input

javascript
controlled-inputs
react-components
state-management

How to make Sequelize use singular table names

javascript
sequelize
database
model

Add class to <html> with JavaScript?

javascript
prompt-engineering
best-practices
cross-browser-solutions

How to make a radio button unchecked by clicking it?

javascript
event-delegation
javascript-features
accessibility

Wait until all promises complete even if some rejected

javascript
promise-engineering
error-handling
async-programming

Repeat a string in JavaScript a number of times

javascript
prompt-engineering
performance
polyfills

How to add custom HTML attributes in JSX

javascript
jsx
react
custom-attributes

Is it possible to hide the cursor in a webpage using CSS or Javascript?

javascript
cursor-manipulation
pointer-lock-api
cross-browser-compatibility