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 9047861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:00:23+00:00 2026-06-16T12:00:23+00:00

I have the following HTML: <div class=button accessLink id=loginLink data-action=Login data-dialog=access data-disabled=no data-entity=n/a data-href=/User/Access/Login

  • 0

I have the following HTML:

<div class="button accessLink" id="loginLink" data-action="Login" 
data-dialog="access" data-disabled="no" data-entity="n/a" 
data-href="/User/Access/Login" title="Login" 
style="-webkit-user-select: none;" data-title="Login">Login</div>

I have some code and when I step through the debugger I see the following get
executed with $(targetSelector) set to #loginLink.

$(targetSelector).attr('data-disabled', 'yes');

When I check again with the chrome developer tools then I see:

<div class="button accessLink" id="loginLink" data-action="Login" 
data-dialog="access" data-disabled="no" data-entity="n/a" 
data-href="/User/Access/Login" title="Login" 
style="-webkit-user-select: none;" data-title="Login">Login</div>

Can someone explain why data-disabled does not seem to change?

  • 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-16T12:00:24+00:00Added an answer on June 16, 2026 at 12:00 pm

    Your debugger might not be refreshing changed values or you might be missing something, you need to print them to see the change e.g using alert. You statement seems correct and is changing the attribute.

    Live Demo

    $('#loginLink').attr('data-disabled', 'yes');    
    alert($('#loginLink').attr('data-disabled'));
    

    You are try​ing to change data attribute and jQuery gives you data() function to set and get the data attributes so you would using data() instead of attr().

    Live Demo

    $('#loginLink').data('disabled', 'yes');
    alert($('#loginLink').data('disabled'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML: <div class=button accessLink id=loginLink data-href=/User/Account/Login title=Login>Login</div> What I need
I have the following HTML: <div class=button disabled dialogLink id=edit data-action=Edit > <div class=sprite-blank
I have the following: <div class=btn-group> <input disabled=disabled id=dialogType> <button data-toggle=dropdown class=dropdown-toggle> <span class=caret></span>
I have the following html: <a id=page-width href=# class=button> <div class=icon sprite-application-text ></div> </a>
I have the following starting HTML: <div id=modal ><div class=modal-window> <ul class=action-tabs right> <li><a
I have the following code: HTML: <div id=login class=transparent-div login_leaf_class> <input class=pointer login_fields_button id=submit_button
I have the following HTML code <div class=text>bla bla bla bla</div> <div class=button>Show</div> And
Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
I have the following html : <div class=mainmenu> <ul class=blue> <li class=><a href=tst/ id=a1_up><span
So I have some html that looks like the following: <div class='something unknown' id='something_unknown_1'>

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.