Sorry, maybe I don't understand what it is you need. The example above picks out the accountId value. It doesn't actually do it inside the onclick handler; it does it in a Javascript function the onclick handler calls. But the effect is just as if you had the alert line (with merge field value) directly in the onclick handler.
Is it that you're trying to do this inside an iteration?
This works for me:
but i cant pick the 'accountId' from the merge fields while writing the onclick javascript on a button.How would I pick that.
Sorry, maybe I don't understand what it is you need. The example above picks out the accountId value. It doesn't actually do it inside the onclick handler; it does it in a Javascript function the onclick handler calls. But the effect is just as if you had the alert line (with merge field value) directly in the onclick handler.
Is it that you're trying to do this inside an iteration?