Skip to content

Tag: jquery

Get the id of input on keyup

I have an input box… When I type in the field, it will go to function lookup(). From there I want to get the id of this input. I tried… but this won’t work. Any suggestions on how I can get the id? Answer Because you are passing this.value to your lookup() function. It’s better to pass…

Dynamically disable select menu based on text field value

I’d like to be able to disable a select menu on my page when a user starts typing in a text field. This is because the text field is an alternative way to enter the data and disabling the dropdown menu will help make that clearer. I know I could use this: to disable the select permanently, but is there

Verify External Script Is Loaded

I’m creating a jquery plugin and I want to verify an external script is loaded. This is for an internal web app and I can keep the script name/location consistent(mysscript.js). This is also an ajaxy plugin that can be called on many times on the page. If I can verify the script is not loaded I’ll…

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 …