/    Sign up×
Community /Pin to ProfileBookmark

Need help with changing variables Onclick..

Hello,

I have this part of the code:
<a href=’#n’ onClick=’javascript: remove_category(“.$cat_info[‘id’].”,”.$num_of_cat.”)’ class=’remove_cat’ >

And I have a javascript function which updating some values and ids according to my needs,
Now I wont to update/change the second variable in: remove_category(“.$cat_info[‘id’].”,”.$num_of_cat.”)
in my function.

Can someone please tell me how can i Change it? Is there anything like
getElementByOnclick or anything that can help me ?

thank you very much
suami.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@tianxzDec 11.2008 — I think you only need add an other onclick event.
Copy linkTweet thisAlerts:
@suamiauthorDec 11.2008 — Sorry but I dont understand what you mean,

I'll try to explain myself again i'm trying to do i guess something like this:

I want to change the variables which i have in my code in the javascript function it suppose to be changed like this i guess but i can't do it properly..

remove.onclick = function() {remove_category(del_id,cat_id_num -1)}
×

Success!

Help @suami 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 6.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...