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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:44:46+00:00 2026-06-18T12:44:46+00:00

This is selected HTML elements: var array = jQuery.makeArray($(.dersprg tr td:nth-child(6))); this selects some

  • 0

This is selected HTML elements:

var array = jQuery.makeArray($(".dersprg tr td:nth-child(6)"));

this selects some table data which consists of table header text and some irrelevant data. I can interpret the irrelevant data using if statements and extract the information i need, but i can not push it to the array since the types are not the same I suppose. Code is like this:

for(i=0 ; i<array.length ; i++){
    content = array[i].innerHTML;
    if(some conditions){
        array.splice(i--,1);    //eliminate non day elements
        array.push('test input <br>');  //problematic line
    }
}

You see, i use innerHTML to compare the content of selected <td> element, but when it comes to adding some test input the whole array renders empty. I think this is due to type mismatch, but i could not figure out how i can solve this. Any help is highly appreciated.

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

    Try this :

    var cell=document.createElement('td');
    cell.appendChild( document.createTextNode('test input <br>') );
    array.push(cell);
    

    This will insert a <td> in the array instead of a string.

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

Sidebar

Related Questions

I've built a jQuery selector for a function which looks like this: $('html').not('.table-main tr[selected]').mousedown(
I have an array with HTML elements from a selector. Looks like this: var
This is how my html looks, <tr id=group-1-11> <tr class=child-of-group-1-11 selected-group=1 > <tr id=group-1-12
I have this jQuery code to add <select> elements in a table row with
I have some javascript that looks like this: var sel = '<option value={value} {selected}>{name}</option>';
Suppose I have a specific table selected in TinyMCE, like this: var ed =
by using print_r($_POST); i am getting data something like this Array ( [selected_friends] =>
I have div-elements when i click on DIV, i add class selected of this
I have HTML which looks something like this: <span id=text> <span class=segment id=first>some text</span>
I'm using jQuery sortable with 2 Ordered List HTML elements. When the page first

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.