473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

using getobjectbyname javascript

3
hi
i have a table let say 10x10
how can i go to each td and check the innerhtml value without giving an id
for each td
i canot give an id for each td because the table is build by a function
thank u
( i am trying to build a cross puzzel with a javascript code and i nedd to know the value of each td)
Dec 16 '09 #1
5 4809
Dormilich
8,658 Expert Mod 8TB
how can i go to each td and check the innerhtml value without giving an id for each td
loop through all cells of that table, returned by getElementsByTagName()

i canot give an id for each td because the table is build by a function
that is a lame excuse. although I admit, generating IDs is not very convenient.

a simple example in PHP could look like
Expand|Select|Wrap|Line Numbers
  1. echo '<td id="cell' . $count++ . '">cell content</td>';
Dec 16 '09 #2
eldad
3
thanks but can u be more specifice with the answers is javascript
not php
what do u meen by loop what kind of loop
Dec 16 '09 #3
Dormilich
8,658 Expert Mod 8TB
what do u meen by loop what kind of loop
whatever you like. for, while, do … while, pick one of them.

can u be more specifice with the answers is javascript
what kind of more specific? the principle of creating the IDs ain’t much different in other languages, including JavaScript.
Dec 16 '09 #4
acoder
16,027 Expert Mod 8TB
If you're going to use elem.getElementsByTagName("td") (elem being the table or tbody element), there's no need to set any IDs. Check out a simple JavaScript tutorial on the different types of loops (see the off-site links thread for some links). If you're familiar with a C-style language, JavaScript loops should be pretty easy to pick up.
Dec 22 '09 #5
eldad
3
thank u very much u where very helpfull
Dec 22 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Alex Fitzpatrick | last post by:
Just by way of introduction, I'm currently the principal developer and maintainer of the a JavaScript editor plug-in for Eclipse. https://sourceforge.net/projects/jseditor/ The plug-in as it...
15
by: Mel | last post by:
if you know of dynamic expandable folder using CSS and display function, please drop me a note Yours, Mel
13
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
24
by: jonathon | last post by:
Hi all, I have a web app with a popup window for entering data. I don't want to access the web every time this window is opened, as most of the app is AJAX. But I can't figure out how to open...
7
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of...
0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
0
AnuSumesh
by: AnuSumesh | last post by:
Hi All, I want to call RDP on Page load and it is working fine.My code is in C#. But I am unable to perform following functions 1. when i disconnected from RDP, i want to go back to...
7
by: JDOMPer | last post by:
Don’t misunderstand me – I use AJAX, but I think there is a far simpler, elegant alternative that just uses Javascript, the DOM and Php ( hence - JDOMP) for data transfers, and is cross-browser...
6
Frinavale
by: Frinavale | last post by:
Apparently I have a lot of questions today regarding JavaScript security. I've implemented a JavaScript Object that intercepts page submits (postbacks) and then displays a UI prompting the user...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.