Search Results

Search found 3 results on 1 pages for 'dalbaeb'.

Page 1/1 | 1 

  • how to prevent checkbox check when clicking on link inside label

    - by dalbaeb
    Hello, I have a link inside a label. The problem is, when user clicks 'back' after having read the terms, the checkbox is unchecked, because when they clicked on the link they also unchecked the box at the same time, since the link is inside a label. <input type="checkbox" id="terms" name="terms" checked="checked" /> <label for="terms">I agree to be bound by the <a href="/terms">Terms</a></label> How can I prevent the checkbox from being checked when link is clicked? Tried doing event.preventDefault() on label click, but that doesn't prevent checkbox from being checked/unchecked. I could just take out the link from inside a label (which means more CSS styling). But now I'm curious whether the above is possible.

    Read the article

  • an array of strings as a jQuery selector?

    - by dalbaeb
    I have an array of strings that are valid jQuery selectors (i.e. IDs of elements on the page): ["#p1", "#p2", "#p3", "#p4", "#p5"] I want to select elements with those IDs into a jQuery array. This is probably elementary, but I can't find anything online. I could have a for-loop which creates a string "#p1,#p2,#p3,#p4,#p5" which could then be passed to jQuery as a single selector, but isn't there another way? Isn't there a way to pass an array of strings as a selector? EDIT: Actually, there is an answer out there already.

    Read the article

  • How can code in a JavaScript file get the file's URL?

    - by dalbaeb
    I need to dynamically load a CSS stylesheet into a page that's on a different domain. How can I get the complete URL of the JS file to use in the href attribute of the stylesheet? For instance, here is the structure: http://bla.com/js/script.js http://bla.com/css/style.css I want to dynamically load the stylesheet into a page http://boo.net/index.html. The problem is, I don't know the bla.com bit in advance, just the fact that the stylesheet is in ../css/ relative to the JS file. The script is, of course, included on index.html. jQuery's fine too.

    Read the article

1