Writing Javascript to a specific <td> tag.

Posted on 2008-06-12
Last Modified: 2013-11-19
I would like to write the Javascript error to id"tel" <td> tag, on the same page. How would i go about doing this?


<script type="text/javascript">

function validate_required(field,alerttxt)


with (field)


if (value==null||value=="")

  {document.write(alerttxt);return false;}

else {return true}


}function validate_form(thisform)


with (thisform)


if (validate_required(email,"Email must be filled out!", 'tel')==false)

  {email.focus();return false;}





<form action="submitpage.htm"

onsubmit="return validate_form(this)"


Email: <input type="text" name="email" size="30">

<input type="submit" value="Submit"> 

</form><table width="200" border="1">


    <td id="tel">&nbsp;</td>




Open in new window

Question by:agulaid
1 Comment
LVL 11

Accepted Solution

JohnSixkiller earned 500 total points
Comment Utility
Hi, use

document.getElementById("tel").innerHTML = alerttxt;

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now