View, hide, type and generate password
Love to make things as simple as possible xD A hint just inside the input (where you can type), then a button to show the password if you want to see it and finally a button to generate random passwords.
Love to make things as simple as possible xD A hint just inside the input (where you can type), then a button to show the password if you want to see it and finally a button to generate random passwords.
Sort an array of objects by their properties values.
The easiest way to do a POST in JavaScript: using fetch.
Select each element in a selection loop. If you go forward as soon as you finish the list of elements you will start selecting from the beginning and the same if you go in opposite direction.
Don’t forget to use nextElementSibling and previousElementSibling (DOM Elements) instead of nextSibling and previousSibling (DOM Objects). A DOM Object can be anything: comments, insolated text, line breaks, etc. In our example nextSibling would have worked if we had set all our HTML Elements together without anything between then:
<ul><li></li><li></li></ul>
AJAX request using ES6 Promises with fetch and XMLHttpRequest. Notice that the url needs https because we request from https and the server should allow all origins (Access-Control-Allow-Origin: *)
Fetch is simpler and cleaner, it avoid callback hell and having to remember the complex API of XMLHttpRequest.