简体   繁体   中英

How to Change 2 Onclick Button Tobe 1 Button

Im working out with this Onclick Button

The Question is how to make that 2 button be 1 button

<a class="btn btn-primary" onClick="document.getElementsByClassName('player-embed')[0].style.width='70%';">
     Normal Views
</a>
<br>
<br>
<a class="btn btn-primary"  onClick="document.getElementsByClassName('player-embed')[0].style.width='100%';">
    Theater Views
</a>

use a function with the parameters you are demanding to change. such as the width. then call that function from onClick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM