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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:58:02+00:00 2026-05-14T23:58:02+00:00

if (tag == ‘td’ && $(this).hasClass(‘status’)) { // I am clearing everything inside the

  • 0
 if (tag == 'td' && $(this).hasClass('status')) {
        // I am clearing everything inside the td with class status
        $(this).html('')
    }

But it doesn’t seem to clear… Any suggestion…

I am customizing a form plugin,

$.fn.clearForm = function() {
    return this.each(function() {
        var type = this.type, tag = this.tagName.toLowerCase();
        if (tag == 'form')
            return $(':input', this).clearForm();
        if (type == 'text' || type == 'password' || tag == 'textarea' )
            this.value = '';
        else if (type == 'checkbox' || type == 'radio')
            this.checked = false;
        else if (tag == 'select')
            this.selectedIndex = -1;
        else if (tag == 'td' && $(this).hasClass('status')) {
            // if you want to remove everything, use this
            $(this).html('');
        }
    });
};
  • 1 1 Answer
  • 1 View
  • 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-14T23:58:03+00:00Added an answer on May 14, 2026 at 11:58 pm

    Looking at the code (in your edit), and assuming you call the function by doing something like $('#myForm').clearForm() (where myForm is a form element), then its never going to process td elements. The code takes a form & then recurses onto that form’s :input elements to clear them. Given that td is not an input, they won’t be included in the clearing.

    If that is how you’re using it, you could customise it as follows to get it to clear your tds (within the form) as well:

    $.fn.clearForm = function() {
        return this.each(function() {
            var type = this.type, tag = this.tagName.toLowerCase();
            if (tag == 'form') {
                $('td.status', this).empty();
                return $(':input', this).clearForm();
            }
            if (type == 'text' || type == 'password' || tag == 'textarea' )
                this.value = '';
            else if (type == 'checkbox' || type == 'radio')
                this.checked = false;
            else if (tag == 'select')
                this.selectedIndex = -1;
        });
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this tag into my html file: {{block:my_test_block}} {{news:my_test_block2}} I need to parse
In my customized inclusion tag, like this: @register.inclusion_tag('templatetags/div_text.html') def div_text(text): return {'text' : text}
Tag this with send-me-the-codez if you will. I've been asked to assist in putting
I have the following tag in HTML: <div data-dojo-type=dojox.data.XmlStore data-dojo-props=url:'http://135.250.70.162:8081/eqmWS/services/eq/Equipment/All/6204/2', label:'text' data-dojo-id=bookStore3></div> I have
This tag and its children can be replaced by one and a compound drawable
Label tag coding style. Can I write my label tag like this. <input type=text
Image tag inside email message: <img src=http://www.mydomain.com/image.php?lastest=1> Part of image.php script: case 'image/gif': header('Content-type:
Note the tag: VBA , not VB6, not VB.NET. This is specific to VBA
type Tag(Kids) = member this.Kids = Kids static member (-) (this: Tag, that: list<obj>)
select tag:- <%=select_tag names,options_from_collection_for_select(@users,id,name,@user.id)%> Right now my dropdown looks like this:- john matt sara

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.