Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <p id="k"></p>
- Vendos cmimin:<input type="text" id="cm">
- <input type="button" value="ok" onclick="f()">
- <script>
- var makina={
- marka: "benz",
- fuqia: 6.3,
- klasi: "S",
- afisho: function(){
- return this.marka+" "+this.fuqia+" "+this.klasi;
- }
- };
- document.getElementById("k").innerHTML=makina.afisho();
- </script>
- <script>
- function f(){
- var b=parseInt(document.getElementById("cm").value);
- document.getElementById("k2").innerHTML=makina.afisho()+" " +b;
- }
- </script>
- <p id="k2"></p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement