加载HTML内容转换成DIV转换成、加载、内容、DIV

2023-09-11 01:35:01 作者:终成陌路

我试图加载一个HTML文件到一个DIV和访问,每当我需要的。 这应该加载脚本的时候做一次,我可以访问此NO.OF 时间在我的code。该HTML包含大量在它的div和我想要得到 从加载的内容特别股利。 这是我的code $(#contentdiv)的负载(message.html #divname);

I am trying to load a HTML file into a DIV and access that whenever i need. This should be done once when loading the script and i can access this no.of time in my code. The HTML contains lots of divs in it and i want to get particular div from the loaded content. Here is my code $("#contentdiv").load("message.html #divname");

u能告诉我如何从这种摆脱

can u tell me how to get rid from this

在此先感谢

推荐答案

从你的问题我明白ü要选择从中将在 #contentdiv 。

From your question I understood that u want to select a particular div from the response html which will be loaded on #contentdiv.

其更好地访问$('#contentdiv->乌尔格名称)HTML()。 或$('#contentdic .div)。HTML()。这里.div是一个CSS类

Its better to access $('#contentdiv->ur div name').html(); or $('#contentdic .div').html() . here .div is a css class