-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
39 lines (38 loc) · 1.16 KB
/
index.html
File metadata and controls
39 lines (38 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="fa" dir="ltr">
<meta charset="utf-8">
<head>
<link href="assets/style.css" rel="stylesheet" type="text/css"/>
<title>border shampoo</title>
</head>
<body>
<div class="menu">
<input type="text" placeholder="اسم محصول" id="nameD" onkeyup="set()">
<input type="number" placeholder="قیمت محصول" id="priceD" onkeyup="set()">
</div>
<div class="container">
<div class="flexItem">
<div class="ibutn">
<img src="./assets/img/alian.jpg" alt="alian" class="image">
<div class="price">
<p id="price">1000</p>
</div>
</div>
<div class="productName">
<h3 id="name">اسم جنس</h3>
</div>
</div>
</div>
<script>
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function set() {
let name = document.getElementById("nameD").value;
let price = document.getElementById("priceD").value;
document.getElementById("name").innerHTML = (name);
document.getElementById("price").innerHTML = numberWithCommas(price);
}
</script>
</body>
</html>