开发者

Migrating from jQuery to Prototype (code snippet)

开发者 https://www.devze.com 2023-03-11 18:19 出处:网络
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 fol

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

精彩评论

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