“So greifen Sie in HTML JavaScript -Variable zu” Code-Antworten

HTML -Ruf -JavaScript -Variable

<!DOCTYPE html>
<html>
    <body>
        <!--\|/id here-->
        <p id="myText"></p>
        <p id="myTextTag"></p>
        <script>
            <!--Here we retrieve the text and show what we want to write...
            var text = document.getElementById("myText");
            var tag = document.getElementById("myTextTag");
            var toWrite = "Hello"
            var toWriteTag = "<a href='https://stackoverflow.com'>Stack Overflow</a>"
            <!--...and here we are actually affecting the text.-->
            text.innerHTML = toWrite
            tag.innerHTML = toWriteTag
        </script>
    <body>
<html>
Rafael Oliveira

So greifen Sie in HTML JavaScript -Variable zu

It is impossible to access a JavaScript variable using
HTML. HTML is completely different to JavaScript, it is
a markup language (HTML stands for Hyper Text Markup
Language), meaning it is only used to format or prepare
base content that is displayed.
MattDESTROYER

Ähnliche Antworten wie “So greifen Sie in HTML JavaScript -Variable zu”

Fragen ähnlich wie “So greifen Sie in HTML JavaScript -Variable zu”

Weitere verwandte Antworten zu “So greifen Sie in HTML JavaScript -Variable zu” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen