/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Var Text on button

Hi everyone
I’m dynamically creating several Button by loop ( quantity from array count )
How can i put var text on button (text from each element of the array)
If i put my $MyVar inside >< bracket… it display the name of the var literally
Thanks

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@AndreaMar 20.2015 — Purtroppo il sito è in sviluppo e non posso dare il link.

Non funziona nel senso che attivato al click levento funziona, mentre nel load pagina senza click non funziona.

Non cè qualche altro metodo?

http://itqueries.com/2008/03/20/using-mozilla-thunderbird-with-windows-mobile/trackback/
Copy linkTweet thisAlerts:
@plaszmaMar 24.2015 — And do you create the buttons using php ?

if so, simply put inside loop

<?php echo "<button id='btn_$id'>$myVar</button>" ?>
[/QUOTE]

Something like that should be enough.

Please put a piece of code here for more help..
Copy linkTweet thisAlerts:
@qcwebdevauthorMar 25.2015 — No sorry for var confusion $

its in javascript and the answer is

in a loop i

..

button[i].innerHTML = button_noms[i];
×

Success!

Help @qcwebdev 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,
)...