Browsed by
Month: August 2018

Get id, name, and class values using Javascript / jQuery

Get id, name, and class values using Javascript / jQuery

Last time, I tried to get each input value using id, name, and class. This time we will use the id to get name/class, name to get id/class and class to get id and name. (I do not remember exactly, sometimes you need them.) Declare the div first. One for using jQuery, the other for using the vanilla javascript. Using jQuery. Using vanilla javascript  (getElementById element is singular, class and name are plural) That’s it. * If you use duplicate…

Read More Read More

Javascript replace all

Javascript replace all

In Python, if you use the replace method of string, all the relevant characters are changed, but in javascript, only the first part is changed and no further progress is made. Solution: Use a regular expression Bonus! How can we change two different characters? Solution: Use regular expressions well.