仅替换div中的文本并使用jquery切换不同的div内容 [英] Replace only text inside div and toggle different div content using jquery
本文介绍了仅替换div中的文本并使用jquery切换不同的div内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在jquery代码下面显示
show below jquery code
$(document).ready(function () {
$('#prvnote').hide();
$('#regclass').click(function () {
$('#prvnote').toggle(400);
$('#newdiv').toggle(400);
});
});
显示以下HTML代码此div仅用作菜单
show below HTML code This div only use as menu
<div id="regclass"><span>View Previous Note</span></div>
现在何时我点击上面的div con帐篷然后在div下面将显示和上面的span标签内容替换为Post Note
Now when i clicked on above div content then below div will display and above span tag content replace with "Post Note"
<div id="newdiv"><form>......</form></div>
<div id="prvnote"><form>......</form></div>
当div(newdiv)显示时然后跨越内容Post Note,当div(prvnote)显示时,span内容必须是View Previous Note
When div(newdiv) show then span content "Post Note" and when div(prvnote) show then span content must be "View Previous Note"
推荐答案
( document )。ready( function (){
(document).ready(function () {
(' #prvnote')。hide();
('#prvnote').hide();
(' #regclass')。点击( function (){
这篇关于仅替换div中的文本并使用jquery切换不同的div内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文