jQuery .append外部标签 [英] jQuery .append outside tag

查看:103
本文介绍了jQuery .append外部标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对jQuery完全陌生.老实说,这是我的头几天.

I'm completely new to jQuery. To be honest it is my first few days.

这是我的第一个问题.

$(document).ready(function() {
    $('span.head-span').parent().addClass('head-h').append('<div class="clx" />')
});

结果,我有这个

<h1 class="head-h"><span class="head-span">This is Some Heading</span><div class="clx"/></h1>

我需要在jQuery中做什么,以便我的.clx出现在之后.像这样

What do I need to do in jQuery so my .clx will appear after . like this

<h1 class="head-h"><span class="head-span">This is Some Heading</span></h1><div class="clx"/>

非常感谢您.

推荐答案

您应该可以使用

这篇关于jQuery .append外部标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆