Skip to content

Tag: javascript

Why do results vary based on curly brace placement?

Why do the code snippets below, taken from this article, produce different results due to only a single change in the placement of curly braces? When the opening curly brace { is on a new line, test() returns undefined, and “no – it broke: undefined” is displayed in the alert. When the brace…

Get CSS path from Dom element

I got this function to get a cssPath : But i got something like this : html > body > div#div-id > div.site > div.clearfix > ul.choices > li But to be totally right, it should look like this :html > body > div#div-id > div.site:nth-child(1) > div.clearfix > ul.choices > li:n…

HTML Templates in Javascript? Without coding in the page?

I am a web guy doing mostly Perl server-side stuff, and I’m slowly coming to a few conclusions. It is far better to do most of your code via Javascript and toss data back and forth via AJAX than it is to hit submit and reload a mostly-identical page I like jQuery because I like CSS, and it’s fun t…

How to change the text of a label?

I have a radiobutton list and on click on the radio button item I have to change the text of its label. But for some reason it’s not working. Code is below: Answer ASP.Net automatically generates unique client IDs for server-side controls. Change it to In ASP.Net 4.0, you could also set the ClientIDMode…

how to alert javascript object [duplicate]

This question already has answers here: How can I display a JavaScript object? (40 answers) Closed 2 months ago. I am trying to study the jquery class, but I have a hard time debugging an object because I can’t see the element inside of it it returns [object Object].. 🙁 My question is how can I alert th…

Javascript comment stripper [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 4 years ago. Improve this ques…

Description Box using “onmouseover”

I am playing with the onmouseover event in javascript I would like a little box to pop up and remain up until there is no onmouseover anymore I think it’s called a description box, but I am not sure. How do I get a little box to pop up with custom text when I put my mouse over certain text,

Getting HTML form values

How can I get the value of an HTML form to pass to JavaScript? Is this correct? My script takes two arguments one from textbox, one from the dropdown box. Answer HTML: JS: