Skip to content
Advertisement

Tag: jquery

Check if mouse is over element A OR element B

Is it possible to check if the mouse is over one of two elements? I have this code which will hide my menu: I would like to execute the animation only if the mouse is no longer over .chapterMenuContainer OR another class called .chapterMenuHeading. These two classes need to be siblings for structural reasons. Is it possible to check if

Selecting previous element in DOM

I’m having a hard time with some JS DOM traversal. I’m stuck with html that’s something like this: This is all hidden by default. I’m trying to use a text field so that if it matches an h4 person-name, it displays the some-content container, as well as the preceding h2. I can make it work for the some-content bit, but

How to set initial dropdown value using javascript?

I am trying to select the value selected in the dropdown using the value from the local storage. My dropdown code for html looks like this. I am trying to set the value selected in the dropdown like this. But this does not work. Answer The semantic-ui docs (that I found) are limited on API methods, so there’s probably a

Generate html in for each with closing tag every 4 loop

I’m trying to generate the following html : So I tried the following : But doesn’t output the desired result Answer Try like below. And check changes with comment. There are two changes in your code. You need to open your row div with i%4 == 0 and close it with i%4 == 3. Once each loop complete you should

Get HTML Table Row by Value

I have a HTML Table: I want to make a JS function that will find “Sam” in the first column and replace the second column with “Green” This is a function based off another article, it find any word matching searchText in the table and replaces it with the replace string. What I want to do is filter only by

Advertisement