第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

嘗試使用 JS 使 HTML 中的 img 可點擊

嘗試使用 JS 使 HTML 中的 img 可點擊

繁星coding 2023-06-09 17:18:58
我希望我的 HTML 中的文本區(qū)域僅通過單擊我的 HTML 中的 img 出現(xiàn)。我正在嘗試找出一種使用 JS 中的 onclick 事件的方法;但我不太清楚該怎么做。有人對我的方法有什么建議嗎?任何幫助將不勝感激。謝謝,麻煩您了。<script>function myFunction() {  document.getElementById("itg").innerHTML = ;}</script><style>  #itg{    height:150px;    width:150px;    border-radius:50%;    align:top;  }    body{        background-image:url("codercup.png"),linear-gradient(to right,white,#c3c3c3);        background-repeat: no-repeat;        background-size: 600px, 700px;        background-position:bottom,center;      }        li{        list-style-type:none;        padding:0;        margin:0;        font-size:20px;    }        h1{        text-align:center;    }        nav{        float:right;        height:500px;            }            .resume{        align:bottom-left;    }  </style>
查看完整描述

1 回答

?
紅顏莎娜

TA貢獻1842條經(jīng)驗 獲得超13個贊

  1. 將文本從文本區(qū)域移動到 JavaScript 函數(shù)

  2. 將 an 添加id到文本區(qū)域,以便您可以定位它

  3. 將此 id 放入您的getElementById函數(shù)中

function myFunction() {

  const textArea = document.createElement("textarea");

  textArea.rows = 10

  textArea.id = "text";

  textArea.cols = 30;

  textArea.readonly = true;

  textArea.innerHTML = `I have been learning and creating web page content since 2015.  

            I'm a part-time student in Information Technology with a concentration in web development, also a self taught developer.

            I have freelance experience creating multiple different projects (mostly front-end).

            I'm inspired of programming from the constant growth in technology.  I enjoy creating things as I have always had an artistic mind; so mixing the passion of creativity, with my love for tech programming feels perfect for me.`

  const nav = document.getElementsByTagName("nav")[0];

  const header = document.getElementsByTagName("header")[0];

  header.insertBefore(textArea, nav);

}

<style>#itg {

  height: 150px;

  width: 150px;

  border-radius: 50%;

  align: top;

}


body {

  background-image: url("codercup.png"), linear-gradient(to right, white, #c3c3c3);

  background-repeat: no-repeat;

  background-size: 600px, 700px;

  background-position: bottom, center;

}


li {

  list-style-type: none;

  padding: 0;

  margin: 0;

  font-size: 20px;

}


h1 {

  text-align: center;

}


nav {

  float: right;

  height: 500px;

}


.resume {

  align: bottom-left;

}


</style>

<!DOCTYPE html>

<html>


<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <meta http-equiv="X-UA-Compatible" content="ie=edge">

  <title>Evin McReynolds Portfolio</title>


</head>


<body>

  <header>

    <h1><strong>About Evin</strong></h1>

    <img src="ITguy.jpeg" id="itg" onclick="myFunction() " />


    <nav>

      <ul class="link ">

        <li><a href="EMport.html ">Home</li></br>

                <li>About Evin</li></br>

                <li><a href="contactem.html ">Contact Evin</a></li>

        </br>

        <li><a href="skillsem.html ">Skills</a></li>

        </br>

        <li><a href="EvinPro.html ">Projects</a></li>

      </ul>

    </nav>


    </p>

  </header>

  <section>


    <embed src="evinITresume.pdf " width="350px " height="400px " class="resume " />

  </section>

</body>


</html>


查看完整回答
反對 回復(fù) 2023-06-09
  • 1 回答
  • 0 關(guān)注
  • 198 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號