Linked Questions

1 vote
1 answer
4k views

I am trying to add a fontawesome.com icon class ("fa fa-arrow-right")to a span in my website site but since it contains spaces I get an error. What can I do to fix this? This is the error I ...
Gwilym Hughes's user avatar
1 vote
1 answer
3k views

I want to change the appearance of two buttons when either one of them is clicked. But I cannot seem to do that. I want the classes of the buttons to be changed every time a new button is clicked, ...
aronccs's user avatar
  • 294
0 votes
2 answers
1k views

I'm trying to add multiple css selectors to an element using classList that's inside a function, but keep getting the below error. How do I do this right? Uncaught DOMException: Failed to execute 'add'...
Norman's user avatar
  • 6,395
0 votes
1 answer
757 views

I try to use this code in my javascript program: this.classList.remove(RF.DangerClass); Where RF.DangerClass is global variable. But I get error - InvalidCharacterError: String contains an ...
progreccor's user avatar
1 vote
1 answer
128 views

document.getElementById("both-gif").onmouseover=function() {MouseOver()}; document.getElementById("both-gif").onmouseout=function() {MouseOut()}; function MouseOver() { document.getElementById("...
Shaky Edits's user avatar
0 votes
3 answers
69 views

I want to add classes named like those in data array (categories) to each boxes in sequence (in container). For example, first box except "box" class should have: "highlighted" "special-header" "...
Traxan's user avatar
  • 1
0 votes
0 answers
69 views

Is there a way to remove the same div class from two separate divs? I have a one-page application and I'm trying to get two of my divs that live in the same tab to hide after you click the other nav ...
Tom Olson's user avatar
  • 105
1 vote
1 answer
68 views

$('.like-btn').click((e) => { e.target.classList = 'like-unlike-btn unlike-btn far fa-heart'; }); $('.unlike-btn').click((e) => { e.target.classList = 'like-unlike-btn like-btn far fa-heart'...
user avatar
0 votes
0 answers
37 views

I am assigned to create this to do list using eventlisteners and using JavaScript. My HTML and CSS are given to me however I believe I may be confusing my Id's with each other. The expectation is ...
Travis Loiselle's user avatar
0 votes
0 answers
33 views

I have tried searching this but it seems that it's not common for a site to only allow for JS injection vs CSS. I have done some CSS coding on my other WordPress sites successfully but just switched ...
mitchfin's user avatar
0 votes
0 answers
243 views

i've got snippet for this function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("Text", ev.target.id); ev.dataTransfer.setData("class", ev....
Eric Anthony Wu's user avatar
0 votes
3 answers
101 views

I was trying to manipulate the css when clicking on button using javascript . I want to just make a single button active the one which is recently clicked. I am able to make it active but somehow i am ...
user avatar
2 votes
2 answers
102 views

When I press a <button>, I want to wait for an asynchronous function, then add some classes to the <button>, but it doesn't work. I want to use jQuery to do this. Here is my code: $("#...
Frio Espacial's user avatar
-3 votes
2 answers
79 views

Hey I have to give some list items their own classes. But my way of doing it is a bit too much. Is there a way to make this cleaner with a loop or something like that? Javascript: function ...
J. Coderino's user avatar
-1 votes
2 answers
50 views

<div id="overlay_block" class="overlay-type overlay" data-text-placement="{{ block.settings.overlay_position }}" data-mobile-text-placement="{{ block....
datacleaner's user avatar