我已经div命名为movingImage每次单击按钮时我都想向右移动 50px。
这是我的javascript:
function moving_Image() {
document.getElementById("movingImage").style.right = "50px";
}
Run Code Online (Sandbox Code Playgroud)
和 html:
<h1 id="movingImage"> __________ </h1>
<input type="button" value="click me" onclick="moving_Image()">
Run Code Online (Sandbox Code Playgroud)