Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Doubt pertaining to javascript

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
In the following script
what I have understood is:
<i>getElementId() retrives the reference to
first element having the attribute "datatable"
then
<ii>tbl.row.length gives the length of each row
<iii>.insertRow(lastRow) inserts a row onto the table element
<iv>insertCell(0) inserts a cell to the row
<v>document.createTextNode(iteration) creates a index.. how??
< vi> Then cell0.appendChild(textNode) appends a text to the cell...
<vii> insertCell(1) creates another cell
<viii>cell1.innerHTML=document.getElementById('Criteria').value assigns
the value of 1st element with id as criteria.

please tell me why innerhtml is used??why not appendChild()??
next doubt: does insertCell(2) inserts the 2nd cell??

please go through the above points I mentioned and verify each point and if its
wrong then please tell me meaning of each of the lines so that I can understand each of the below
code..... please help me soon...... I'm having exam tomorrow please spare some time to read the
all above points and verify.please help me.



I'm eagerly waiting for your reply...

Thanks in advance
with regards
 
Marshal
Posts: 67446
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

RabiDas Sharma wrote::
<i>getElementId() retrives the reference to
first element having the attribute "datatable"
then


Incorrect. Look up the description of the method (I recommend the Mozilla Dev Network) to see why this is wrong.

You can do this for every question that you posted. Look up the method or property on your own, then, and only then, ask questions about them if there is still confusion.

 
My pie came with a little toothpic holding up this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic