Jquery:为每个类添加一行

goo*_*ing 2 jquery

我有类,dot并有这样的HTML代码:

<span class="dot">Text1</span>
<span class="dot">Text2</span>
<span class="dot">Text3</span>
Run Code Online (Sandbox Code Playgroud)

我想添加dot自动添加类附加文本的每个元素.例如,添加&#8226;它可能的代码

<span class="dot">&#8226; Text1</span>
<span class="dot">&#8226; Text2</span>
<span class="dot">&#8226; Text3</span>
Run Code Online (Sandbox Code Playgroud)

我想它应该用jquery完成,所以任何帮助?

谢谢.

Jus*_*ier 6

尝试使用prepend方法:

jQuery(".dot").prepend("&#8226;");
Run Code Online (Sandbox Code Playgroud)