130 lines
3.1 KiB
HTML
130 lines
3.1 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<link rel="stylesheet" href="style.css"/>
|
||
|
<link href="https://fonts.googleapis.com/css?family=Raleway&display=swap" rel="stylesheet">
|
||
|
|
||
|
<body>
|
||
|
<script>
|
||
|
|
||
|
// document.body.onload = addElement;
|
||
|
|
||
|
function addHeader() {
|
||
|
var newDivhead = document.createElement("div");
|
||
|
var shop = document.createTextNode("EURO RTV AGD");
|
||
|
var date = document.createTextNode("24-03-1996");
|
||
|
var xshop = document.createElement("h3");
|
||
|
var xdate = document.createElement("h3");
|
||
|
xshop.classList.add("headboxmap");
|
||
|
xdate.classList.add("dateboxmap");
|
||
|
xshop.appendChild(shop);
|
||
|
xdate.appendChild(date);
|
||
|
newDivhead.appendChild(xshop);
|
||
|
newDivhead.appendChild(xdate);
|
||
|
|
||
|
var currentDiv = document.getElementById("div2");
|
||
|
document.body.insertBefore(newDivhead, currentDiv);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
function addElement () {
|
||
|
// create a new div element
|
||
|
var newDiv = document.createElement("div");
|
||
|
// and give it some content
|
||
|
|
||
|
|
||
|
var price = document.createTextNode("$ 123zł");
|
||
|
|
||
|
var prod = document.createTextNode("2 szt.");
|
||
|
var device = document.createTextNode("Pralka BOSH Z345-5TRQ");
|
||
|
|
||
|
|
||
|
var xprice = document.createElement("SPAN");
|
||
|
|
||
|
var xprod = document.createElement("SPAN");
|
||
|
var xdevice = document.createElement("SPAN");
|
||
|
|
||
|
|
||
|
xprice.classList.add("pricemap");
|
||
|
|
||
|
xprod.classList.add("numbmap");
|
||
|
xdevice.classList.add("devicemap");
|
||
|
|
||
|
|
||
|
xprice.appendChild(price);
|
||
|
|
||
|
xprod.appendChild(prod);
|
||
|
xdevice.appendChild(device);
|
||
|
|
||
|
newDiv.appendChild(xdevice);
|
||
|
newDiv.appendChild(xprod);
|
||
|
|
||
|
newDiv.appendChild(document.createElement("br"));
|
||
|
newDiv.appendChild(document.createElement("br"));
|
||
|
|
||
|
|
||
|
|
||
|
newDiv.classList.add("listbox");
|
||
|
|
||
|
|
||
|
var image = document.createElement("img");
|
||
|
var image2 = document.createElement("img");
|
||
|
|
||
|
image.id = "id";
|
||
|
image.className = "mapimg";
|
||
|
image.src = "pin.png"; // image.src = "IMAGE URL/PATH"
|
||
|
newDiv.appendChild(image);
|
||
|
|
||
|
image2.id = "id";
|
||
|
image2.className = "mapimg2";
|
||
|
image2.src = "cont.png"; // image.src = "IMAGE URL/PATH"
|
||
|
newDiv.appendChild(image2);
|
||
|
|
||
|
newDiv.appendChild(xprice);
|
||
|
|
||
|
var currentDiv = document.getElementById("div1");
|
||
|
document.body.insertBefore(newDiv, currentDiv);
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
<div class="headmap"> <script> addHeader(); </script> </div>
|
||
|
|
||
|
|
||
|
<script> addElement(); </script>
|
||
|
|
||
|
<div class="listbox">
|
||
|
<div id="gdate"> gwarancja ważna do: </div> <br/><br/>
|
||
|
<span id="time" style="font-weight: bold;"> Okres gwarancji: </span> <br/><br/>
|
||
|
<span id="yes"> Gwarancja obejmuje: </span> <br/><br/>
|
||
|
|
||
|
<span id="no"> Gwarancja nie obejmuje: </span>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<script>function guaranty (){
|
||
|
|
||
|
|
||
|
var sdate = document.getElementById("gdate");
|
||
|
var stime = document.getElementById("time");
|
||
|
var gdate = document.createTextNode("22-09-2022");
|
||
|
sdate.appendChild(gdate);
|
||
|
|
||
|
var time = document.createTextNode("2 lata");
|
||
|
stime.appendChild(time);
|
||
|
var yes = [["uszczelki"],
|
||
|
["szkło"],
|
||
|
["pokrywę wierzchnią"]];
|
||
|
|
||
|
|
||
|
var no = [["uszczelki"],
|
||
|
["szkło"],
|
||
|
["pokrywę wierzchnią"]];
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
guaranty();
|
||
|
</script>
|
||
|
</body>
|