Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

linked html pages

I need help in this project.

in my html file I put

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

I need when I click in the button submit, the page link this html file with other html

for example link hello.html.

can you help me please?

in my html file I put

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

Please post the code or a link to the code.

3 Answers

<h1>External and Internal Links and Anchors </h1><br> <p>Depends what element you are trying to link and where,<br>
below are some examples. </p><br>

<link rel="stylesheet" href="css/my.css" type="text/css"/>  
<img src="img/nameoffile.jpg">  
 <a href="http://externalsite.com">click here to go to site</a>  
 Links
 <a href="URL"></a> Creates a hyperlink 

<a href="mailto:EMAIL"></a>  Creates a mailto link 

<a href="URL"><img src="URL"> </a> Creates an image/link

<a name="NAME"></a> Creates a target location within a document

<a href="#NAME"></a> Links to that target location from elsewhere in the document. 

An anchor is created using the  <a> tag.
If you want to create an anchor called chapter4, you simply add this line where you want the anchor to be:

<a name="chapter4"></a> 
After doing this, you can make a link pointing to the anchor using the normal <a href>  tag, like this:
Click <a href="#chapter4">here</a>   to read chapter 4. 

This is an links anchors documentation<br> This is an Another links anchors documentation

this is my code.

<!DOCTYPE html> <html> <head> <title>Formulario de registro || j.Query</title> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8"> </head> <body>

<form action="#" method="post">
    <p>
        <label for="username">Nombre de usuario</label>
        <input id="username" placeholder="email@website.com" name="username" type="email">
    </p>
    <p>
        <label for="password">Password</label>
        <input id="password" name="password" type="password">
        <span>Ingrese sus password maximo de 8 carateres</span>
    </p>
    <p>
        <label for="confirm_password">Confirme su Password</label>
        <input id="confirm_password" name="confirm_password" type="password">
        <span>Por favor verifique su password</span>
    </p>
    <p>
        <input type="submit" value="ENTRAR" id="submit"> in this part is where i need link the page in the moment in I do click in the button "Entrar" this input me send other page html for example hello.html
    </p>
</form>
<script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/app.js" type="text/javascript" charset="utf-8"></script>

</body> </html>

this is the page where i need linked my form in the moment clicking in the value="ENTRAR"

<html> <head> <title>hello</title> </head> <body> <p>hello word</p> </body> </html>

<input type="submit" value="ENTRAR" id="submit">  

Hi Josue, if you want to click on a submit button to send or retrieve info, this would need to be a server-side language, if you want to use the form and input elements. But if you just want to link to an html page, dont use the form elements, look at the examples i gave above. Hope this helps.

Do you want a form "submit" button or a hyper link that says "submit"?

Incase you want a link you can do this!

<a href="example.html">Submit</a>

if you have any further questions just ask!

Hope this helps!

// erdrag