Migrating from jQuery to Prototype (code snippet)
I am using Ruby on Rails 3 and I am migrating from jQuery to Prototype but I am a newbie with the first JavaScript framework so I have some trouble. I would like to write the jQuery version of the following Prototype code:
page.select("#test_id").each do |element|
element.replace( "Test text )
end
开发者_StackOverflow中文版
How can I do? What is the code?
$('#test_id').html('Test text');
or
$('.test_class').each(function(){
$(this).html('Test text');
});
精彩评论