How can i create an element like this in javascript dynamically because i want to loop it while it is fetching content in the database.
With jQuery:
For simplicity supouse only:
other
try
$('').class('card').append(
$('').class('card-image waves-effect').append(
$('
').class('activator').src('images/office.jpg'),
$('').text(other)
)
);
or with pure Javascript try:
var div=document.createElement('div');
div.className='card';
var div2=document.createElement('div');
div.appendChild(div2);
etc...