hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Javascript to change text on an html page?
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Javascript to change text on an html page?

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 03-03-2008, 04:41 PM
housefire housefire is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 84

Javascript to change text on an html page?


Wondering if anyones got some simple code to update text on an html page after a javascript on click action?

Reply With Quote


Sponsored Links
  #2  
Old 03-03-2008, 05:00 PM
ilyash ilyash is offline
Web Hosting Master
 
Join Date: Dec 2002
Location: NY, NY
Posts: 3,975
Quote:
Originally Posted by housefire View Post
Wondering if anyones got some simple code to update text on an html page after a javascript on click action?
Assuming your text is in a div or something.. give it an id
<div id="blah"> POOO </div>

After the action just do

document.getElementById("blah").innerHTML = "MEOW";

Reply With Quote
  #3  
Old 03-03-2008, 05:47 PM
housefire housefire is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 84
And if I wanted to pull the value out of that text div to put into another field with js, any idea how id pull the value of it?

Reply With Quote
Sponsored Links
  #4  
Old 03-03-2008, 07:03 PM
Codebird Codebird is offline
Aspiring Evangelist
 
Join Date: Dec 2007
Location: Lebanon
Posts: 415
if you

Code:
<div id="blah"> POOO </div>
<div id="bloh"> MEOW </div>

document.getElementById("blah").innerHTML=
document.getElementById("bloh").innerHTML
this will put MEOW at the place of POOO

__________________
Hicham

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
WHD.global 2013: Open-Xchange Launches Browser-based Office Productivity Suite Web Hosting News 2013-03-20 06:55:56
Web Host Webhostforasp.net Launches New Affiliate Program Web Hosting News 2012-01-16 14:31:12
Hurricane Electric Offers Online Courses for Developers and Designers Web Hosting News 2011-11-14 21:51:44
Landing Page Practices to Improve Marketing ROI with Tim Ash of SiteTuners Web Hosting News 2011-08-09 22:20:06
Colocation Firm Mac Mini Vault Uses Apple TV as Web Server in 24-Hour Experiment Web Hosting News 2011-05-20 19:57:22


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?