Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2011, 04:24 AM
Authorized User
 
Join Date: Dec 2009
Posts: 30
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via Yahoo to kirangentlebreeze1987
Default problem getting cell value from table

Code:
<td name="updatetemplate_change">
<a href="javascript:changeTemplateName(this)"><p id="p_tempname" class="word-wrap">kiran</p></a>
this is my javascript code

Code:
function changeTemplateName(name){
 var tableref=document.getElementById("templatetable1").rows[1].cells;
 alert(tableref[1].innerText);
}
now the problem is it is displaying the whole p tag,i should get only the value what is inside the p tag i.e kiran
help me i am a newbie
 
Old August 29th, 2011, 02:08 PM
Authorized User
 
Join Date: Jan 2010
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Default

You may want to use following line in function

function changeTemplateName(name){
var tableref=document.getElementById("p_tempname");
alert(tableref.innerText);
}

Kushal Kaleshwari
__________________
Kushal Kaleshwari
Application Architect





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert value in a table cell snufse ASP.NET 2.0 Basics 0 July 28th, 2009 03:30 PM
ReportViewer - Table cell expression problem VerbatimBOT .NET Framework 2.0 0 September 25th, 2008 08:41 AM
layers in table cell dearmisskat HTML Code Clinic 12 March 10th, 2007 04:46 AM
Hyperlink in a cell table amc Dreamweaver (all versions) 33 August 5th, 2004 12:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.