Given below is part of my website
<body controller="contr">
<h1 bind="greeting"></h1>
<p bind="text"></p>
</body>
I need to bind the values of contr properties
contr.greeting = 'Hello, World!';
contr.text = 'Lorem Ipsum ..';
to h1 and p tags when:
if controller == 'contr'
so it will be interpreted as
<h1 bind="greeting">Hello, World!</h1>
<p bind="text">Lorem Ipsum ..</p>
How I can implement this in JQuery? What is best source to learn more about such DOM binding with JS and JQuery
<h1 bind="greeting">Jasper</h1>
<script language="javascript">
$(document).ready(function () {
$("h1[bind='greeting']").html('Hello World');
});
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With