开发者

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');
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜