/    Sign up×
Community /Pin to ProfileBookmark

im looking for a way to grab all innerText values of a list of divs and then split them by types in the code i wrote i took the firs set of divs and turned them into inouts with the innertext as the class name and tthe second set and turned them into the input value.. what im looking to do is now sort them add all values with the same classnames together.. any idea on how to do this? they dont need to be inputs they can be arrays or anything.. catch is i wont know how many divs there are so i cant just say all that = this class name blah blah blah.. heres what i have so far.

any help would be greatly appreciated

[code]
<script>

function rounder(){
j=document.getElementById(‘joker’).getElementsByTagName(‘div’);
for (i=0;i<j.length;i++) {
k = j[i];
if (k.className.match(“active-column-3″)) {
kf=k.innerText;
var aElement=document.createElement(‘input’);
aElement.name=’name’+i;
aElement.id=’id’+i;
aElement.className=’N_’+kf.replace(/-/g,”);
//aElement.setAttribute(“onclick”,”alert(this.className)”);
}
if (k.className.match(“active-column-5″)) {
kf=k.innerText;
aElement.value=kf;
oData.appendChild(aElement);
}
}
v=document.getElementById(‘oData’).getElementsByTagName(‘input’);
jol=”;
for (z=0;z<v.length;z++) {
kk = v[z];
}
}

</script>
[/code]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @pentace spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...