I am facing an issue with modifying an element using Fx.Tween, but the problem lies in the fact that the element id is dynamically generated. This means I need to piece together the id from various variables.
For example, in JavaScript:
name = 'foo';
id = '42';
If I want to access the element $('foo_42')
, how should I write it out?
It seems like $(name+'_'+id)
is not working for me. Am I doing something wrong?
Here is an example from my code:
var highlight = new Fx.Tween($(accountID+'_'+type+'_'+permission), {
background-color: #f00;
});
Update: It appears there was no answer to this question - the issue was actually a mistake in my usage of the Fx.Tween function in the code sample. Thank you all for your input.