Replace getElementById with querySelector

This commit is contained in:
Simon Ser 2020-04-25 12:48:50 +02:00
parent cc3a41aa03
commit 19ee9be928
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
var server = { var server = {
name: "chat.freenode.net", name: "chat.freenode.net",
url: "ws://localhost:8080", url: "ws://localhost:8080",
username: "soju-test-user/irc.freenode.net", username: "soju-test-user/chat.freenode.net",
realname: "soju-test-user", realname: "soju-test-user",
nick: "soju-test-user", nick: "soju-test-user",
pass: "soju-test-user", pass: "soju-test-user",
@ -10,10 +10,10 @@ var server = {
var buffers = {}; var buffers = {};
var activeBuffer = null; var activeBuffer = null;
var bufferListElt = document.getElementById("buffer-list"); var bufferListElt = document.querySelector("#buffer-list");
var logElt = document.getElementById("log"); var logElt = document.querySelector("#log");
var composerElt = document.getElementById("composer"); var composerElt = document.querySelector("#composer");
var composerInputElt = document.getElementById("composer-input"); var composerInputElt = document.querySelector("#composer input");
function djb2(s) { function djb2(s) {
var hash = 5381; var hash = 5381;

View file

@ -19,7 +19,7 @@
</div>--> </div>-->
</section> </section>
<form id="composer"> <form id="composer">
<input type="text" id="composer-input" placeholder="Type a message"> <input type="text" placeholder="Type a message">
</form> </form>
<script src="assets/irc.js"></script> <script src="assets/irc.js"></script>