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.

HTML Forum


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



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
how to write html code
Old 09-16-2009, 12:06 AM how to write html code
Junior Talker

Posts: 1
Name: Surjit
Trades: 0
hi!
<a href="example.html" id=menu1">
i want to write (target="_blank") this in above <a ....... > without adding any php code to it

just using its id="menu1"

please tell me how can i do this
surjit is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-16-2009, 12:34 AM Re: how to write html code
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
I'm not sure I understand what you're getting at...

Code:
<a href="example.html" id="menu1" target="_blank">
Is there some reason why you can't just do that?

HTML and PHP are distinct.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 09-16-2009, 02:49 PM Re: how to write html code
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
And, if you're using an XHTML doctype, the "target" attribute is not valid, it's deprecated!
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-17-2009, 06:05 PM Re: how to write html code
Junior Talker

Posts: 4
Name: frank
Trades: 0
There is no reason you can't write it the way NullPointer describes. I think you may be a little unfamiliar with the difference between HTML and PHP. There is no PHP involved in what you're trying to do. Give it a try.
__________________

Please login or register to view this content. Registration is FREE
speak66 is offline
Reply With Quote
View Public Profile
 
Old 09-22-2009, 08:46 AM Re: how to write html code
Super Talker

Posts: 118
Name: Sumit Arora
Trades: 0
You can do it through simple html.

Just add target="_blank" in anchor tag.

If you have been using dreamweaver, it would be more easier for you.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


karmadir is offline
Reply With Quote
View Public Profile
 
Old 09-23-2009, 05:51 AM Re: how to write html code
Ultra Talker

Posts: 256
Location: Auckland, New Zealand
Trades: 0
I think the way surjit wrote what he requires without php is the clue, then again maybe I'm just too fond of cryptic riddles.

I think he's actually looking at doing this with javascript and inserting the target="_blank" using the id menu1.

That would make sense if he is, so really it's a JS question, but to help him out add this to your body tag.

Code:
<body onload="javascript:getElementById('menu1').setAttribute('target', '_blank');">
Now the problem with this code however is that the document may not be ready, which means menu1 may not exist when trying to find the id menu1 and causes the script to be an error.

Usually I use javascript libraries like jquery - http://www.jquery.com/ instead of reinventing the wheel, that handle the document status and allows you to apply the code when needed, also has a lot of other nifty features you may be interested in, especially easier ways of adding attributes to required elements.

Hope this helps you, if not, hope it helps someone else!


Cheers,


MC
__________________
#------------------------------signature---------------------------------------------------------------------------------#
Quote:
I am well recognised for what I don't do than what I do. Chores are just one of those things.
mastercomputers is offline
Reply With Quote
View Public Profile Visit mastercomputers's homepage!
 
Old 09-28-2009, 01:29 AM Re: how to write html code
Junior Talker

Posts: 2
Trades: 0
  1. Step 1
    Open your document in TextEdit. Choose a monospaced typeface such as Courier. This will make your code easier to read.
  2. Step 2
    Type your head and body tags to start the document ("", "" and "", ""). These tags are essential to make your page readable in the browser. You don't need to add anything between the "," tags (these are reserved for page features such as the page title and meta data).
  3. Step 3
    Add your content (page titles, paragraphs, etc) between the "" tags. Use carriage returns between paragraphs to see where you want to add formatting code. This will allow you to concentrate on your content and code in separate stages.
  4. Step 4
    Insert the formatting code. Place the cursor at the beginning of each paragraph. Type the code to format that block of text (e.g., "
    ", ""). Place the cursor at the end of each paragraph and type the code to end the formatting (e.g., "


    ", "").
  5. Step 5
    Use carriage returns and spaces to layout your HTML code. Don't use tabs. Two spaces will be fine for each tab if you're using a monospaced font. Browsers don't read carriage returns or spaces between HTML headings which make them ideal for breaking up complicated code like table cells and rows.
  6. Step 6
    Save the file in HTML format. Choose "Save As" from the File menu and change the extension to .htm, not .txt.
  7. Step 7
    Drag the HTML file onto your browser icon to preview the document. If your formatting doesn't look right, make the proper changes in your HTML file.
  8. ================================================== ===
Investment Leads
antigua family resorts
jokana99 is offline
Reply With Quote
View Public Profile
 
Old 09-28-2009, 09:09 AM Re: how to write html code
alfianz's Avatar
Novice Talker

Posts: 12
Name: Alfian Khoirul Bahroin
Trades: 0
<a href="url" target="_blank">name</a>
__________________
Why my site hacked??
Please login or register to view this content. Registration is FREE
alfianz is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how to write html code
 

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 2.17659 seconds with 12 queries