jquery更改div中的文本

jos*_*osh 1 jquery

现在div文本被更改为"text"我需要将其更改为链接中的"data-text".

<a href="1884.html" class="brieflink" data-src="article.jpg" data-text="text4">Brief 4</a>

<div id="brieftext"><p>Text to be replaced</p></div>

$("a.brieflink").bind("mouseover", function() {
    $("div#brieftext").text("text", $(this).data("text"));
});
Run Code Online (Sandbox Code Playgroud)

Mat*_*att 8

$("div#brieftext").text($(this).attr("data-text"));
Run Code Online (Sandbox Code Playgroud)

我学到了:

$("div#brieftext").text($(this).data("text"));
Run Code Online (Sandbox Code Playgroud)

也将在1.4之后工作,感谢@Rocket.