Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
Can someone please help me solve this problem. I want to show a submit button when users click on the anchor tag. The problem is, the button is initially hidden, but when I click on the anchor tag, nothing happens
The HTML code is as follows:
<html>
<head>
<style>
#reveal
{
visibility:hidden;
}
</style>
</head>
<body>
<div>
<a href="javascript:" onclick='showButton();'>k...#ccs.neu.edu</a>
</div>
<form>
<input type="submit" value="show email address" id="reveal"/>
</form>
<script type="text/javascript">
function showButton() {
document.getElementById("reveal").style.visibility = visible;
}
</script>
</body>
</html>
Use document.getElementById("reveal").style.visibility = 'visible'; instead of document.getElementById("reveal").style.visibility = visible;
You do not want to assign a variable, but a value, which should be put on quotes.
Use 'visible' instead of visible. You want to use a value, not a variable there.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 days ago.
Improve this question
I have an html where I need to show a link after a determined date, For example I want that the link href='https://sample.it' will be visible only after 2023-02-25
I have no idea how to do
Assuming you are not using anything special, one of the possible solutions is to use PHP: put this code around your <a>.
<?php
if((new DateTime("now")) > (new DateTime('2023-02-25'))) {
?>
<a ...>...</a>
<?php
}
?>
We can do it using html and javascript
var currentdate = new Date();
if (currentdate < Date.parse('2023-02-25')) {
document.getElementById('link').style.display = 'none';
}
<!DOCTYPE html>
<html>
<title>HTML Tutorial</title>
<body>
<h1>This is a heading</h1>
<a href='https://sample.it' id='link'>https://sample.it</a>
</body>
</html>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
Improve this question
Code I think
the door + text
the door changes into a open door after clicking it but is there a way for the 'woah' to change into for example 'text2' after clicking the closed door??
I'm new to html so I don't know much
someone told me to use document.getElementById but didn't give me any more information and I do not know where to put in the id
You can achieve what you want with basic Javascript, but if you don't know it yet, consider finding some good tutorial to get started.
The code you're looking for is something like
<!doctype html>
<html>
<head>
<title>Update Image and Text</title>
<!-- Define your function here -->
<script>
function updateImageAndText() {
//Update image url
document.getElementById("image").src = "https://via.placeholder.com/150/FFFF00/000000?text=open+door";
//Update paragraph text
document.getElementById("text").innerText = "New text";
}
</script>
</head>
<body>
<img id="image" src="https://via.placeholder.com/150/FFFF00/000000?text=closed+door" onclick="updateImageAndText()" />
<!-- Call your function here -->
<p id="text">Initial Text</p>
</body>
</html>
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed last month.
Improve this question
The code was just a practice for my html study and the image is not popping up like i want it to i want to know why.
<!DOCTYPE html>
<body>
<p>
<h1> This is ur mom texting </h1>
<p>hello human of the world this is your mom and i disapoprove of you all</p>
this the link
<p>
<img src="f7e55d6f07a6f29a827017134ccc6321.jpg" alt=https://www.google.com width"100" height"100" >
</p>
</body>
Use this instead
<img src="f7e55d6f07a6f29a827017134ccc6321.jpg" alt="https://www.google.com" width="100" height="100" >
Yhe syntax of an attribute is as follows
attributeName="value"
Note the " and the =
src must lead to an image, not just the name of the image
you have to give the link to the image depending on where the HTML file is located
So I supposed that your image is in the same place as the HTML file
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I would like to know how to put a button on my code and when I click it, it displays text.
For example: when I click it and it should say thank you.
how I can put this in code form?
this is a code based on what I understood from your question
<!DOCTYPE html>
<html>
<body>
<button id="demo" onclick="myFunction()">Click me.</button>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "thank you!";
}
</script>
</body>
</html>
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Here's the code I'm working with more or less.
<!DOCTYPE html>
<html lang="en">
<body>
<header></header>
<div class="container">
<section>
<h1>Title</h1>
<pre>
Text <A herf="linkurl.com">Link</A> Text
</pre>
</section>
</div>
<footer></footer>
</body>
</html>
I'm trying to get the URL Hyperlink to work inside of the <pre></pre>. What am I missing here?
You are missing the fact that you spelled href as herf.
Looks like you are missing the protocol in the link. So before linkurl.com there should be something like http:// or https:// for a web-site, ftp:// for an FTP-resource and etc.