Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:43:14+00:00 2026-06-08T00:43:14+00:00

I have a text input with a label: <li data-role=fieldcontain> <label for=number>Amount:</label> <input type=number

  • 0

I have a text input with a label:

<li data-role="fieldcontain">
<label for="number">Amount:</label>
<input type="number" name="number" id="vitalamount" value=""  />
</li>

I’m now trying to change the label of the input, but the following code didn’t work.

$("#vitalamount").attr("label","something else");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:43:16+00:00Added an answer on June 8, 2026 at 12:43 am

    attr modifies the attributes of an element not it’s sibling elements, you can use prev() or siblings for selecting the label and changing it’s texts:

    $("#vitalamount").siblings("label").text('something else');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have input text: <div><label wicket:for=name>Name</label><input type=text wicket:id=name /></div> Now I need to add
I have some HTML like this: <input type=radio class=MyRadio name=TheName> <label for=TheLabel>the text</label> How
I have this form in HTML: <form action=# method=post> <label for=label-id>id</label> <input type=text name=id
I have this code: <form action= id=credentials method=post> <label for=name id=nameLabel >Name*:</label> <input type=text
Suppose I have knockout.js template like this: <script type=text/html id=mytemplate> <label for=inputId>Label for input</label>
A label tag is of the form: <label for=id_of_text_field> <input type=text name=example id=id_of_text_field />
I just wanted to ask. I have text input to allow users to type
I have a text input : <input type=text onkeydown=processText(this) /> I have a processing
<form action=<?php $self ?> method=post> <h2>LundaBlogg</h2> <div class=fname><label for=name><p>Namn:</p></label><input name=name type=text cols=20 onkeyup=EnforceMaximumLength(this,12)/></div> <div
I have an input text which is this: <div class=editor-label> @Html.LabelFor(model => model.EmployeeId, Employee

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.