I have a javascript constructor that takes a DOM element as an argument, and I’d like to pass in the image generated from this rails helper:
Rails helper:
<%= image_tag("/images/" + photo.file_name) %>
JS:
function Tagger(element) {
this.photo = element;
...
}
A solution that doesn’t use an external library like jQuery would be great.
Would something like this be sufficient?
Suggestion: If you’re using Rails I would suggest using jQuery (I know you requested a solution w/o jQuery) as Rails provides it by default and it would make your life a LOT easier.