Javascript 要用作按钮HTML的图像
你好,我有这个代码:Javascript 要用作按钮HTML的图像,javascript,jquery,html,image,button,Javascript,Jquery,Html,Image,Button,你好,我有这个代码: <!-- Button that triggers the popup --> <button id="my-button">POP IT UP</button> <!-- Element to pop up --> <div id="element_to_pop_up">Content of popup</div> 弹出来
<!-- Button that triggers the popup -->
<button id="my-button">POP IT UP</button>
<!-- Element to pop up -->
<div id="element_to_pop_up">Content of popup</div>
弹出来
弹出窗口的内容
我有这样的图像:
<img src="botones/bannerdiseno_audifonosinpilas.png" width="160" height="33" alt=""/>
</a><a href="tecnologia.html">
我想知道如何更改该图像上的链接,使其与按钮相同,我应该使用什么语法,因此每当我单击该图像时,它都会触发按钮操作并删除按钮本身
谢谢您可以使用
或
您可以使用该按钮并使用CSS使其看起来像图像。现在,我如何实际隐藏或删除该按钮?因为我使用“我的按钮”文档调用它。getElementById('my-button')。style.display='none';或者使用jQuery$(“#我的按钮”).hide()或者您可以
<input type="image" src="submit.gif" alt="Submit">
<img onclick="document.getElementById('my-button').click()" src="botones/bannerdiseno_audifonosinpilas.png" width="160" height="33" alt=""/>
or
<a href="javascript: document.getElementById('my-button').click()"> <img src="botones/bannerdiseno_audifonosinpilas.png" width="160" height="33" alt=""/></a>