<div class="calc-wrapper">
<div class="calculator">
<div class="input-wrap">
<input readonly="readonly" dir="rtl" value="0" type="text" class="input">
// Атрибут dir -
</div>
<div class="buttons-wrap">
<!-- 1 ряд -->
<div value="remLastSym" class="casual-btns back-btn">←</div>
<div value="clearInp" class="casual-btns CE-btn">CE</div>
<div value="remLastDig" class="casual-btns C-btn">C</div>
<div value="+" class="casual-btns plus-btn">+</div>
<!-- 2 ряд -->
<div value="7" class="casual-btns btn-seven">7</div>
<div value="8" class="casual-btns btn-eight">8</div>
<div value="9" class="casual-btns btn-nine">9</div>
<div value="-" class="casual-btns btn-minus">-</div>
<!-- 3 ряд -->
<div value="4" class="casual-btns btn-four">4</div>
<div value="5" class="casual-btns btn-five">5</div>
<div value="6" class="casual-btns btn-six">6</div>
<div value="*" class="casual-btns btn-multiply">*</div>
<!-- 4 ряд -->
<div value="1" class="casual-btns btn-one">1</div>
<div value="2" class="casual-btns btn-two">2</div>
<div value="3" class="casual-btns btn-three">3</div>
<div value="/" class="casual-btns btn-split">/</div>
<!-- 5 ряд -->
<div value="0" class="btn-zero casual-btns btn-zero">0</div>
<div value="." class="casual-btns btn-three">.</div>
<div value="=" class="casual-btns btn-equally">=</div>
</div>
</div>
</div>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<form id="form">
<input type="text" id="name"/>
<input type="text" id="image"/>
<input type="submit" id="add" />
</form>
</body>
</html>
window.onload = function() {
let form = document.querySelector("#form");
let addElem = (text, src) => {
let div = document.createElement("div");
let h2 = document.createElement("h2");
let img = document.createElement("img");
img.src = src;
div.append(img);
h2.textContent = text;
div.append(h2);
return div;
}
form.onsubmit = () => {
let name = document.querySelector("#name");
let image = document.querySelector("#image");
document.body.append(addElem(name.value, image.value));
return false;
}
}
function search() {
var words = search_words.value
words = words.replace("<", "");
words = words.replace(">", "");
var text = document.getElementById('container').innerHTML
if (!words.length) alert("Пусто!");
var result = text.replace(new RegExp(words,'g'), "<div id='blink' style='color:Red; display:inline;'>" + words + "</div>");
document.getElementById('container').innerHTML = result;
}