Skip to content

Tag: javascript

Does scrollIntoView work in all browsers?

Does scrollIntoView() work in all browsers? If not is there a jQuery alternative? Answer It is supported yes, but user experience is… bad. As @9bits pointed out, this has long been supported by all major browsers. Not to worry about that. The main problem is the way that it works. It simply jumps to a p…

Remove multiple elements from array in Javascript/jQuery

I have two arrays. The first array contains some values while the second array contains indices of the values which should be removed from the first array. For example: I want to remove the values present at indices 0,2,4 from valuesArr. I thought the native splice method might help so I came up with: But it …

CreateElement with id?

I’m trying to modify this code to also give this div item an ID, however I have not found anything on google, and idName does not work. I read something about append, however it seems pretty complicated for a task that seems pretty simple, so is there an alternative? Thanks 🙂 Answer You should use the .…

Select Radio Button if a Dropdown is Selected

I’m wondering how I can use JavaScript to accomplish the following: I have an input area with five dropdownlists, and each one has a corresponding radio button. When a dropdownlist is clicked to make a selection, I would like the radio button paired with it to become checked right then. Any help would b…