Thursday, 27 September 2018

JQUERY : DOM manipulation / Change id content using jquery

Same as javascript getElementById("");

FOR TEXT

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

</head>
<body>

<div id="demo">
   <p>The initial text</p>
</div>


<script>
$(document).ready(function(){
  $('#demo').text('The replaced text.');
});
</script>
</body>
</html>

FOR HTML




<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

</head>
<body>

<div id="demo">
   <p>The initial text</p>
</div>


<script>
$(document).ready(function(){
  $('#demo').html('<b>The replaced text.</b>');
});
</script>
</body>
</html>

SEO: Trik Terbaik

Lebih 30 Trik Carian Google untuk SEO GraphicLab Gunakan kombinasi carian ini untuk: Mengesan sebutan jenama Mencari peluang backli...