Skip to content

Tag: javascript

assigning value from object without specifying the index

Let us say I have an object below and I have 2 variable. The length of the object is always fixed. I wanted to assign the object index attribute value to variable A and object index 1 to variable B. I can do like A = data[0].attributeValue; and B = data[1].attributeValue; but is there a better and clean way t…

Get summary number from only visible table rows

I have a code which counts a total summary of all price table cells. This is not exactly what do I need. I need to count the summary from only visible rows. I use filtering by date range, once I change date it displays only dates from the selected date range, but the summary price is from the all rows.

How to loop over document.body in a function

I have to write a version of getElementsByClassName but i’m having trouble using document.body in my function. It only returns null when called. I realize that the recursion part needs to be fixed and finished but first I’d like to know how to access document.body (along with its childNodes) and u…

Change checkbox tickmark color

I’ve implemented a function to change the background color of my checkbox , but it makes the tickmark turns to color black which I don’t want , I want the mark to still white , how can I achieve this ? HTML :- here’s the function :- and here’s the output :- the background changed succe…