Skip to content
Advertisement

Tag: javascript

Max characters in textarea with jquery

I have the following code, and I’m kind of stuck on what to do next. The idea is when you enter text into a text area a counter tells you how many characters you have left. Once you get to the max characters I want to stop allowing characters to be entered, or delete all the characters that were entered

Table Row’s OnClick Event is Propagated to all Contained Elements?

I’ve run into some interesting code in our legacy application running under Internet Explorer. Consider the following: So, here’s where I’m stumped. When the user selects an item from the SELECT element, the ONCLICK event is firing, and the following are true: this evaluates to Window Window.event.srcElement evaluates to an array of ‘OPTION’ elements There doesn’t seem to be a

What is the hash tag used for in JavaScript?

I’m not talking about in the URL. I know what that does. I’m talking about how it’s used in actual code. After trying to assign it as a variable, I realized that it’s reserved, but I don’t know what for. Answer Javascript, or more precisely ECMAscript, is an evolving language. Some symbols and keywords (such as “class”) have been reserved

How to detect if multiple keys are pressed at once using JavaScript?

I’m trying to develop a JavaScript game engine and I’ve came across this problem: When I press SPACE the character jumps. When I press → the character moves right. The problem is that when I’m pressing right and then press space, the character jumps and then stops moving. I use the keydown function to get the key pressed. How can

Advertisement