A Pen by Tamo Tkhlashidze
How do I make an a pen by tamo tkhlashidze?
What is a a pen by tamo tkhlashidze? How do you make a a pen by tamo tkhlashidze? This script and codes were developed by Tamo Tkhlashidze on 14 January 2023, Saturday.
A Pen by Tamo Tkhlashidze - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>A Pen by Tamo Tkhlashidze</title>
</head>
<body> <input type="text" value="" id="inp1"/>
<input type="text" value="" id="inp2"/>
<select id="select1"> <option value="1"> value 1 </option> <option value="2"> value 2 </option>
</select>
<input id="chk1" type="checkbox"></input> <script src="js/index.js"></script>
</body>
</html>
A Pen by Tamo Tkhlashidze - Script Codes JS Codes
'use strict';
var ws = new WebSocket("ws://sheltered-gorge-67224.herokuapp.com/nika");
ws.addEventListener('open', function () { // console.log("open");
});
ws.addEventListener('message', function (evt) { var obj = JSON.parse(evt.data); var element = document.querySelector('#' + obj.id); if (obj.componentType == "text") { element.value = obj.value; console.log("input"); } else if (obj.componentType == "checkbox") { element.checked = obj.value; console.log("checked"); } else if (obj.componentType == "select") { element.value = obj.value; console.log("select"); }
});
var elements = document.querySelectorAll('input');
for (var _iterator = elements, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var element = _ref; debugger; element.addEventListener('change', function (evt) { var obj = { id: evt.target.id, value: evt.target.checked, componentType: evt.target.type }; ws.send(JSON.stringify(obj)); });
}
var selectElements = document.querySelectorAll('select');
for (var _iterator2 = selectElements, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var selectElement = _ref2; selectElement.addEventListener('change', function (evt) { var obj = { id: evt.target.id, value: evt.target.value, componentType: "select" }; ws.send(JSON.stringify(obj)); });
}
Developer | Tamo Tkhlashidze |
Username | Nagasaki1991 |
Uploaded | January 14, 2023 |
Rating | 3 |
Size | 2,570 Kb |
Views | 6,072 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Repeater | 2,561 Kb |
Two way binding | 2,638 Kb |
D3 bar chart with svg | 3,071 Kb |
Generate dic.dictionaryitems insert script from cvs file | 1,972 Kb |
Svg | 1,985 Kb |
Custom stack class js | 1,970 Kb |
D3 intro | 2,881 Kb |
Audio test | 1,798 Kb |
Csv to table | 2,333 Kb |
Sticky footer | 2,353 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Placeholder support for contentEditable elements, without JavaScript | Flesler | 1,863 Kb |
Exploring css spinners | Akagr | 3,569 Kb |
Reviews and Ratings Star | Zbnmstry | 1,591 Kb |
CSS3 Form Page Design | Rssatnam | 3,613 Kb |
CSS Gem Badge | Orchard | 3,335 Kb |
A Pen by Rob Levin | Roblevin | 2,787 Kb |
CSS3 iPad | Vikvarg | 1,766 Kb |
Twinner Spinner II | Katydecorah | 2,974 Kb |
Menu | Vivi_Lai | 1,210 Kb |
Simple animated hover effect | Pobee-norris | 3,044 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!