Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var a = this.document.getElementsByTagName('b');
- var participants = a.length - 1;
- var i;
- var player_list;
- var split_list;
- a[0].innerHTML = `<input type='button' id='fill' value="Highlight Names" onclick='javascript:get_names();'> (Seperate names with -)`;
- function get_names(){
- player_list = prompt("Please enter character names, including spaces, seperate them with -'s, example name-name2-name3-name4").toLowerCase();
- split_list = player_list.split(/\-/gi);
- if (split_list !== undefined) {
- for (i = 0; i <= participants; i++) {
- if (split_list.includes(a[i].innerHTML.toLowerCase())) {
- a[i].innerHTML = `<font color=red>` + a[i].innerHTML + `</font>`;
- }
- }
- }
- }
- //Hide players when clicked.
- document.onclick = function(e) {
- if (e.target.innerHTML.indexOf('<b>') < 0) {
- e.target.hidden = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement