English 中文(简体)
在j Query,(机构)可以选择机构要素,但(机构)美元可以像(某些文本)一样,这样如何区分?
原标题:In jQuery, $( body ) can be selecting the body element, but $( body ) can be just like $( some text ), so how to distinguish?

原因是我们能够做到。

$( <div>some text</div> ).prependTo( #someDiv )

这样做也是为了:

$( some text ).prependTo( #someDiv )

但我们可以修改<条码>一些文本至<条码>>。 www.un.org/spanish/ecosoc 如同任何文本一样......

(上述代码是将<条码>部分案文添加至<条码>,附后<条码>,因此,如果我想在条码上添加<条码>。

但(机构......)成为机构要素的选用人...... 还有一条规则说,只要不使用超文本元素的名称,我们就可以使用任何文本作为超文本。

最佳回答

从根本上说,这从来都不有效:

$( generic text here, *not* a selector or HTML );

http://api.jquery.com/jQuery/“rel=“noreferer” 页: 1

http://api.jquery.com/ category/ editedion/dom-insertion-inside/“rel=“noretinger”>DOM 插入方法,在此,>。 在这种情况下:

$( #someDiv ).prepend( any text or html here is valid, <b>Hey look bold</b>. );
问题回答

如果它包含着html的标签,那么它就被当作是html(除了在头对面之前和之后删除案文)。 eg $("<div>some text</div>>。 否则,它就作为甄选人处理,例如$(“some text”)

处理文本节点是JQuery的强权。 您可以采用正常的OMM方法:

$( #someDiv )[0].appendChild(document.createTextNode("body"));

这是因为,j Query在创建超文本幻灯之前考虑挑选器。 “人”是一个有效的选择人,将用作甄选人。

最好将预支职能用于预先发放的超文本或文本,以避免:

 $( #someDiv ).prepend( some text );

发给预支款的价值不用作选择人,你可以添加“人”的案文。





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签