Answer the question
In order to leave comments, you need to log in
How to change the string element of the array and push the changed version into the original array?
I have an initial array gridTemplateAreasArray which consists of one element.
The element has the following value: ""sources auto" "clicks auto" "shows auto" "conversion-price auto" "price auto" "conversion auto" "sales auto"".
I need to overwrite this array via JS so that it looks like:
0: ""sources auto" "clicks auto" "shows auto" "conversion-price auto" "price auto" "conversion auto" "sales auto"",
1: ""sources_twin_1 auto" "clicks_twin_1 auto" "shows_twin_1 auto" "conversion-price_twin_1 auto" "price_twin_1 auto" "conversion_twin_1 auto" "
const table = document.querySelector('.table'),
tableArticles = document.querySelectorAll('.table__article');
const gridTemplateAreas = window.getComputedStyle(table).gridTemplateAreas;
const gridTemplateAreasArray = window.getComputedStyle(table).gridTemplateAreas.split();
Answer the question
In order to leave comments, you need to log in
Easily searchable for "js before after"
https://github.com/jotform/before-after.js?files=1
www.catchmyfame.com/catchmyfame-jquery-plugins/jqu...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question