HTML + Javascript: ¿Cómo puedo cargar datos en Div a través de Class?

I just want to ask if it is possible to separate my View (HTML & CSS files) in such a controller like JavascriptCode/AJAX, and when the time the page was loaded only the controller will bind the data to that specific element like DIV via its class.

¿es posible?

please give me some reference on how to do it.

preguntado el 12 de febrero de 14 a las 08:02

yes it is possible.share some code first. -

sorry but i don't have any code. I just came to an idea that if one person created the layout(html & css) and the one created the backend at both the same time, it will lessen the development period of the project. and only the class or id of an element will be the "glue" to combine those. please help me Milind Anantwar. -

2 Respuestas

You cand add data to a Div using:

$('.ClassName').html(data); // will override all content


$('.ClassName').append(data); // will append content to the actual content of the DIV

Respondido 12 Feb 14, 08:02

You can bind your data to a DIV using jQuery like this:


if you share your code, it would be helpful in providing exact answer :)

Respondido 12 Feb 14, 08:02

thank you for your answer. i really appreciated it Saeedses.. =) - user3274033

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.