cat
cat
KPCKevin Powell - Community
Created by cat on 5/30/2024 in #front-end
how do i select the content
newBook.children[0] contains
<div class="bookTitle">
<h3>Title:</h3>
<span>Think and grow rich</span>
</div>
<div class="bookTitle">
<h3>Title:</h3>
<span>Think and grow rich</span>
</div>
how do i alter the content inside the span tag?
3 replies
KPCKevin Powell - Community
Created by cat on 4/26/2024 in #front-end
creating calculator
let operatorsArray = document.querySelectorAll('.operator')
function bgColor(a){
let bgColorValue = window.getComputedStyle(a)
return bgColorValue.backgroundColor == "white"
}


console.log(operatorsArray.some(bgColor))
let operatorsArray = document.querySelectorAll('.operator')
function bgColor(a){
let bgColorValue = window.getComputedStyle(a)
return bgColorValue.backgroundColor == "white"
}


console.log(operatorsArray.some(bgColor))
161 replies
KPCKevin Powell - Community
Created by cat on 4/19/2024 in #front-end
help with date function of javascript
const date = new Date(2024,2,0)
date.setDate(date.getDate()+4)
console.log(date)
const date = new Date(2024,2,0)
date.setDate(date.getDate()+4)
console.log(date)
if the result of (date.getDate()+4) is 33 then the second line of code should set the date value of the date const to 33, which means the result should be april 02 2024 right? why is march 04 2024 the result then
2 replies
KPCKevin Powell - Community
Created by cat on 2/14/2024 in #front-end
javascript functions
if i declare a variable with the name "xyz" globally ( outside a function ) and give it a value... and then i declare another variable with the same name "xyz" inside a function and give it a different value.. then m i editing the original variable or im declaring a completely different variable?
26 replies
KPCKevin Powell - Community
Created by cat on 2/12/2024 in #front-end
how does sort() work
i wanna know how sort () works
17 replies