0
Description text?
How do you make a text that when clicked shows information?
5 Réponses
+ 7
<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8"
name = "viewport"
content = "width = device-width,
initial-scale = 1.0">
<title>Text description</title>
</head>
<body>
<p style="color:red" onclick="describe()">text to describe</p>
<script>
function describe(){
var p = document.querySelector("p");
p.innerHTML = "description";
}
</script>
</body>
</html>
+ 6
I think you mean with HTML.
You can use an hyperlink to a description page.
Or with JavaScript add an event listener to a paragraph to change the innerHTML of the tag and add the description.
Describe better what you would like to do?
0
And a text that clicks the description below?
0
tanxx at the two
0
:)