Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By glenngv

Thread: [solved] change text on radio button with jquerymobile jqm

  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    79
    Thanks
    2
    Thanked 1 Time in 1 Post

    [solved] change text on radio button with jquerymobile jqm

    The following line does not work.

    $("label[for='pick'] .ui-btn-text").html("new label");

    JS Bin - Collaborative JavaScript Debugging

    How to correct this?
    Last edited by eydg; 02-22-2014 at 05:44 PM.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Why do you have .ui-btn-text? It should just be:

    Code:
    $("label[for='pick']").html("new text");
    But I would prefer this:

    Code:
    $("#pick + label").html("new text");
    Accessing element by id is faster than accessing by tag name with a particular attribute name/value.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •