у меня есть такой код:
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
</head>
<body>
<button onclick="alert('hi')">hi</button><br><br>
<button onmousemove="alert('hi')">hi</button><br><br>
<button ondblclick="alert('hi')">hi</button><br><br>
<div style="border: 1px solid red" onmouseout="alert('hi')">наведи на меня а потом убери</div><br><br>
<input type="text" value="ку-ку" id="inp">
<button onclick="buttClickInputOne();">hi</button><br><br>
<input type="text" value="ку-ку" id="inpa">
<button onclick="buttClickInputTwo();">hi</button><br><br>
<div>
<img src="../photo2.jpg" alt="" id="phoTwo" width="200px" height="200px">
<img src="../photo3.jpg" alt="" id="phoThr" width="200px" height="200px">
<button onclick="changePhotoClick()">click</button>
</div>
<input type="text" id="input_While" onclick="inputWhileTrue()" value="click on me"><br><br>
<input type="text" id="inputChangeOne" onclick="inputChangeOne()" value="click on me"><br><br>
<input type="text" id="inputChangeTwo" onclick="inputChangeTwo()" value="click on me"><br><br>
<input type="submit" value="hhhhhhhhhhhhhhhhhh" id="submitOne" onclick="submitOne()"><br><br>
<input type="submit" value="hhhhhhhhhhhhhhhhhh" id="submitTwo" onclick="submitTwo()">
<div>
<img src="../photo2.jpg" alt="" id="phoTwoFst" width="200px" height="200px" onmousemove="changePhotoOn()">
<img src="../photo3.jpg" alt="" id="phoThrSec" width="200px" height="200px" onmouseout="changePhotoOut()">
</div>
<input type="text" id="inputChangeColor" value="click on me">
<button onclick="inputChangeColor()">click</button><br><br>
<input type="text" id="inputClose/Open" value="click on me">
<button onclick="inputClose()">click</button>
<button onclick="inputOpen()">click</button><br><br>
<input type="text" id="inputCss" value="click on me">
<button onclick="inputCss()">click</button><br><br>
<input type="submit" id="submitBlock" onclick="submitBlock()" value="click on me"><br><br>
<input type="submit" id="submitUnblock" onclick="submitUnblock()" value="click on me"><br><br>
<input type="submit" id="submitClick" onclick="submitClick()" value="click on me"><br><br>
<div style="position: relative; width: 100%; height: 100px;">
<input type="text" id="inputMove" value="click on me" style="position: absolute;">
<button onclick="inputMove()" style="position: absolute; left: 200px;" id="submitMove">click</button><br><br>
</div>
<input type="text" id="inputCsss" value="click on me" style="position: absolute;">
<button onclick="inputCsss()" style="position: absolute; left: 200px;" id="submitCsss">click</button><br><br>
<input type="text" id="inputChangeTwoFst" value="click me" ><br><br>
<input type="text" id="inputChangeTwoSec" value="click on me" >
<button onclick="inputChangeTwo()" id="submitChangeTwo">click</button><br><br>
<script>
function inputChangeTwo(){
var a = document.getElementById("inputChangeTwoFst");
var m = document.getElementById("inputChangeTwoSec");
var n = m.value;
var v = a.value;
m.value = v;
a.value = n;
}
function inputCsss(){
var a =document.getElementById("inputCsss");
a.value = "my css: www eee aaa";
}
function inputMove() {
var a = document.getElementById("inputMove")
var w = document.getElementById("submitMove")
a.style.right ="5px";
w.style.left ="5px";
}
function submitClick() {
var a = document.getElementById("submitClick");
aaa++;
a.value = aaa;
}
function submitBlock() {
var a = document.getElementById("submitBlock");
a.disabled = true;
aa.style.display = "inline";
}
function submitUnblock() {
var a = document.getElementById("submitBlock");
a.disabled = false;
aa.style.display = "none";
}
function inputCss(){
var a = document.getElementById("inputCss");
a.style.border = "0px solid white";
a.value = "css";
}
function inputClose() {
var a = document.getElementById("inputClose/Open");
a.hidden = true;
}
function inputOpen() {
var a = document.getElementById("inputClose/Open");
a.hidden = false;
}
function inputChangeColor(){
var a = document.getElementById("inputChangeColor");
a.style.color= "red";
}
function changePhotoOut(){
var a = document.getElementById("phoTwoFst");
a.style.display = "block";
c.style.display = "none";
}
function changePhotoOn(){
var a = document.getElementById("phoTwoFst");
a.style.display = "none";
c.style.display = "block";
}
function submitTwo() {
var a = document.getElementById("submitTwo");
a.disabled = true;
a.value = "nnnn";
}
function submitOne() {
var a = document.getElementById("submitOne");
a.value = "nnnn";
}
function inputChangeOne() {
var a = document.getElementById("inputChangeOne");
a.value = "i changed my text";
}
function inputChangeTwo() {
var a = document.getElementById("inputChangeTwo");
number++;
if (number == 1){
a.value = "i changed my text";
}else if(number == 2){
a.value = "i changed my text again";
}else{
number = 0;
}
}
function inputWhileTrue () {
var inputWhile = document.getElementById("input_While");
while(true){
alert(this.value);
}
}
function buttClickInputOne() {
var a = document.getElementById("inp");
alert(a.value);
}
function buttClickInputTwo() {
var a = document.getElementById("inpa");
a.value = "asdf";
}
function changePhotoClick(){
var a = document.getElementById("phoTwo");
a.style.display = "none";
b.style.display = "block";
}
var b = document.getElementById("phoThr");
b.style.display = "none";
var c = document.getElementById("phoThrSec");
c.style.display = "none";
let number = 0;
let aa = document.getElementById("submitUnblock");
aa.style.display="none";
let aaa = 0;
</script>
этот код должен из первого input
переводить value
во второй input
и тоже самое со вторым input
, но у меня не хочет переводиться я уже 3 часа мучаюсь и не могу решить эту задачу
Причина ошибки: повторное использование названия функции inputChangeTwo
.
function inputChangeTwo(){
var a = document.getElementById("inputChangeTwoFst");
var m = document.getElementById("inputChangeTwoSec");
var n = m.value;
var v = a.value;
m.value = v;
a.value = n;
}
и
function inputChangeTwo() {
var a = document.getElementById("inputChangeTwo");
number++;
if (number == 1){
a.value = "i changed my text";
}else if(number == 2){
a.value = "i changed my text again";
}else{
number = 0;
}
}
Пример с переименованной функцией
function inputChangeTwoOther(){
var a = document.getElementById("inputChangeTwoFst");
var m = document.getElementById("inputChangeTwoSec");
var n = m.value;
var v = a.value;
m.value = v;
a.value = n;
}
function inputCsss(){
var a =document.getElementById("inputCsss");
a.value = "my css: www eee aaa";
}
function inputMove() {
var a = document.getElementById("inputMove")
var w = document.getElementById("submitMove")
a.style.right ="5px";
w.style.left ="5px";
}
function submitClick() {
var a = document.getElementById("submitClick");
aaa++;
a.value = aaa;
}
function submitBlock() {
var a = document.getElementById("submitBlock");
a.disabled = true;
aa.style.display = "inline";
}
function submitUnblock() {
var a = document.getElementById("submitBlock");
a.disabled = false;
aa.style.display = "none";
}
function inputCss(){
var a = document.getElementById("inputCss");
a.style.border = "0px solid white";
a.value = "css";
}
function inputClose() {
var a = document.getElementById("inputClose/Open");
a.hidden = true;
}
function inputOpen() {
var a = document.getElementById("inputClose/Open");
a.hidden = false;
}
function inputChangeColor(){
var a = document.getElementById("inputChangeColor");
a.style.color= "red";
}
function changePhotoOut(){
var a = document.getElementById("phoTwoFst");
a.style.display = "block";
c.style.display = "none";
}
function changePhotoOn(){
var a = document.getElementById("phoTwoFst");
a.style.display = "none";
c.style.display = "block";
}
function submitTwo() {
var a = document.getElementById("submitTwo");
a.disabled = true;
a.value = "nnnn";
}
function submitOne() {
var a = document.getElementById("submitOne");
a.value = "nnnn";
}
function inputChangeOne() {
var a = document.getElementById("inputChangeOne");
a.value = "i changed my text";
}
function inputChangeTwo() {
var a = document.getElementById("inputChangeTwo");
number++;
if (number == 1){
a.value = "i changed my text";
}else if(number == 2){
a.value = "i changed my text again";
}else{
number = 0;
}
}
function inputWhileTrue () {
var inputWhile = document.getElementById("input_While");
while(true){
alert(this.value);
}
}
function buttClickInputOne() {
var a = document.getElementById("inp");
alert(a.value);
}
function buttClickInputTwo() {
var a = document.getElementById("inpa");
a.value = "asdf";
}
function changePhotoClick(){
var a = document.getElementById("phoTwo");
a.style.display = "none";
b.style.display = "block";
}
var b = document.getElementById("phoThr");
b.style.display = "none";
var c = document.getElementById("phoThrSec");
c.style.display = "none";
let number = 0;
let aa = document.getElementById("submitUnblock");
aa.style.display="none";
let aaa = 0;
у меня есть такой код:
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
</head>
<body>
<button onclick="alert('hi')">hi</button><br><br>
<button onmousemove="alert('hi')">hi</button><br><br>
<button ondblclick="alert('hi')">hi</button><br><br>
<div style="border: 1px solid red" onmouseout="alert('hi')">наведи на меня а потом убери</div><br><br>
<input type="text" value="ку-ку" id="inp">
<button onclick="buttClickInputOne();">hi</button><br><br>
<input type="text" value="ку-ку" id="inpa">
<button onclick="buttClickInputTwo();">hi</button><br><br>
<div>
<img src="../photo2.jpg" alt="" id="phoTwo" width="200px" height="200px">
<img src="../photo3.jpg" alt="" id="phoThr" width="200px" height="200px">
<button onclick="changePhotoClick()">click</button>
</div>
<input type="text" id="input_While" onclick="inputWhileTrue()" value="click on me"><br><br>
<input type="text" id="inputChangeOne" onclick="inputChangeOne()" value="click on me"><br><br>
<input type="text" id="inputChangeTwo" onclick="inputChangeTwo()" value="click on me"><br><br>
<input type="submit" value="hhhhhhhhhhhhhhhhhh" id="submitOne" onclick="submitOne()"><br><br>
<input type="submit" value="hhhhhhhhhhhhhhhhhh" id="submitTwo" onclick="submitTwo()">
<div>
<img src="../photo2.jpg" alt="" id="phoTwoFst" width="200px" height="200px" onmousemove="changePhotoOn()">
<img src="../photo3.jpg" alt="" id="phoThrSec" width="200px" height="200px" onmouseout="changePhotoOut()">
</div>
<input type="text" id="inputChangeColor" value="click on me">
<button onclick="inputChangeColor()">click</button><br><br>
<input type="text" id="inputClose/Open" value="click on me">
<button onclick="inputClose()">click</button>
<button onclick="inputOpen()">click</button><br><br>
<input type="text" id="inputCss" value="click on me">
<button onclick="inputCss()">click</button><br><br>
<input type="submit" id="submitBlock" onclick="submitBlock()" value="click on me"><br><br>
<input type="submit" id="submitUnblock" onclick="submitUnblock()" value="click on me"><br><br>
<input type="submit" id="submitClick" onclick="submitClick()" value="click on me"><br><br>
<div style="position: relative; width: 100%; height: 100px;">
<input type="text" id="inputMove" value="click on me" style="position: absolute;">
<button onclick="inputMove()" style="position: absolute; left: 200px;" id="submitMove">click</button><br><br>
</div>
<input type="text" id="inputCsss" value="click on me" style="position: absolute;">
<button onclick="inputCsss()" style="position: absolute; left: 200px;" id="submitCsss">click</button><br><br>
<input type="text" id="inputChangeTwoFst" value="click me" ><br><br>
<input type="text" id="inputChangeTwoSec" value="click on me" >
<button onclick="inputChangeTwoOther()" id="inputChangeTwoOther">click</button><br><br>
</body>
</html>
Айфон мало держит заряд, разбираемся с проблемой вместе с AppLab
Перевод документов на английский язык: Важность и ключевые аспекты
Как в строке "Организация: %name% %inn%" выделить name и inn в разные переменные?
что будет лучше загружать видео создавать постер к нему в php через ffmpeg и сохранять его или лучше все это делать на js и отправлять его в php и там...
Сайт состоит из 3 частей: header, div#content и footerПри этом, header имеет фиксированную высоту, а footer - нет