JSFiddle - React, Tailwind, and code Playground

by Mohammed Ismail Ansari

HTML

<script src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js"></script>
<a target="_blank" 
    data-bind="text: linkName, attr: { href: linkUrl, title: linkData, 'data-info': linkData }">
</a>

CSS

body
{
    font-family: Arial;
}

JavaScript

// Attr Binding

// Our viewmodel with observables
function viewmodel() {
    self = this;
    
    this.linkUrl = ko.observable("http://www.google.co.in");
    this.linkName = ko.observable("Google");
    this.linkData = ko.observable("Google India");
}

// Runs at document load
$(document).ready(function(){
    // Create an instance of the viewmodel
    var myViewmodel = new viewmodel();
    
    // Bind the instance to the view
    ko.applyBindings(myViewmodel);
});