Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Needs some heelp with html tags in javascript
Old 11-20-2010, 01:26 AM Needs some heelp with html tags in javascript
heat33's Avatar
Skilled Talker

Posts: 82
Name: Don
Trades: 0
HTML Code:
map.openInfoWindow(map.getCenter(),
document.createTextNode('[HTML]<div style="width:200px">Hello Joe</div>
'));[/HTML]

I am playing around with a google map and want to put a div tag to style "Hello Joe" have no given it a ID or class yet, just put a inline style to see it if works.

But what I get back is
HTML Code:
<div style="width:200px">Hello Joe</div>
And not Hello Joe.

What am I doing wrong?
heat33 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-20-2010, 09:41 AM Re: Needs some heelp with html tags in javascript
Backslider's Avatar
Experienced Talker

Posts: 40
Trades: 0
At a guess, I would say that the createTextNode function does exactly that, creates text. Look for the function for HTML
Backslider is offline
Reply With Quote
View Public Profile
 
Old 11-26-2010, 08:50 AM Re: Needs some heelp with html tags in javascript
alexsts's Avatar
Novice Talker

Posts: 14
Name: Alex
Location: USA
Trades: 0
Set empty div on place where you want your text to be with ID and then access/modify InnerHtml of the element via JavaScript...

document.getElementById('yourelementid').innerHTML = 'Fred Flinstone';
alexsts is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Needs some heelp with html tags in javascript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.73669 seconds with 12 queries