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

  • Home
  • SEARCH
  • 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 1031935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:00:29+00:00 2026-05-16T14:00:29+00:00

$(document).ready( function() { $(‘input[id^=btnRemoveCategory]’).bind( ‘click’, function(){ if($(‘input[id^=chkIsBottom_:checked]’)) alert(‘YES YES YES!!!!’); else alert(‘No NO no!!!!!’);

  • 0
$(document).ready(
function()
{   
    $('input[id^="btnRemoveCategory"]').bind(
        'click',
        function(){
            if($('input[id^="chkIsBottom_":checked]'))
                alert('YES YES YES!!!!');
            else
                alert('No NO no!!!!!');

I’ve tried with the:

if($('input[id^="chkIsBottom_"]').attr(checked))

also….

where is my mistake???

10x

  • 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-05-16T14:00:30+00:00Added an answer on May 16, 2026 at 2:00 pm
    $('input[id^="chkIsBottom_":checked]')
    

    … is always going to return a true value. If none are checked, then it will be a jQuery object with no element inside it. You want:

    $('input[id^="chkIsBottom_":checked]').length
    

    (which will be false if the length is 0, and true if it isn’t)

    Meanwhile:

    if($('input[id^="chkIsBottom_"]').attr(checked))
    

    … will get the value of the X attribute of the first input element with an id that starts with chkIsBottom_, where X is whatever the variable checked contains (which is probably undefined, since you probably intended to pass a string).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$('document').ready(function(){ $('[name=mycheckbox]').live('click', function(){ if($(this).is(':checked')) { alert('it is checked'); } else { alert('it is not
$(document).ready(function(){ $('.submit').click(function(){ var value = $('#Name').attr('value'); alert(value); }); }); <input type=text value=10 id=Name/>Hello world
$(document).ready(function(){ $(#CO_createAccount).click( function (){ if(this.checked){ $(.CO_accountForm).show(); } else { $(.CO_accountForm).hide(); } }); }); and
$(document).ready(function() { $('#switcher-default').bind('click', function() { $('body').removeClass('narrow'); $('body').removeClass('large'); }); }); the second function: $(document).ready(function() {
$(document).ready(function() { //set initial state. $('#textbox1').val($(this).is(':checked')); $('#checkbox1').change(function() { $('#textbox1').val($(this).is(':checked')); }); $('#checkbox1').click(function() { if (!$(this).is(':checked'))
$(document).ready(function() { $('#somebutton').click(function() { $.get('List', function(responseJson) { $.each(responseJson, function(index, item) { var elem=$('<input type=checkbox
$(document).ready(function() { $(span#label_Flat).hide(); $(span#added_Flat).hide(); $(span#removed_Flat).hide(); if ($('#Flat:checked').val() != false) { $('#Flat').click(function() { $(span#label_Flat).toggle(); $(span#removed_Flat).toggle();
$(document).ready(function(){ $(#input_6_4\\.3_label).html(City/Borough); $(#input_6_8\\.3_label).html(City/Borough); $(#gform_next_button_6_42).click(function(){ alert(hi); )}; }); Firebug keeps spitting out a syntax error
$(document).ready(function(){ $("#esp").click(function(){ $(".auth_type").slideDown("normal"); $("#no").click(function(){ $(".auth_other").slideUp("normal"); }); $("#yes").click(function(){ $(".auth_other").slideDown("normal"); }); }); $("#ah").click(function(){ $(".auth_type").slideUp("normal"); }); });
$(document).ready(function(){ $(button).click(function(){ $(#inputtext).append(<input type='text' name='photo_1'/><br />); }) }) i wanna photo_1 to auto increment

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.