我在网上看过这个例子:
$('#questionTextArea').each( function() {
var $this = $(this);
var $questionText = $("<textarea class='textAreaQuestion'></textarea>")
.attr('name',$this.attr('name'))
.attr('value',$this.val());
$question.append($questionText);
});
Run Code Online (Sandbox Code Playgroud)
它的位置是'.attr('name',$ this.attr('name'))',这是什么意思?这是否与'id'属性#questionTextArea具有相同的'name'属性,或者与'class'属性'textAreaQuestion'具有相同的'name'?
谢谢