knockout data bind href and text in a tag Edit

Murugan Andezuthu Dharmaratnam | 27 January 2021 | 77

how to data-bind href and text tag in an element using knockoutJs

Solution

If you want to data bind both an attribute and text using knockout js you can separate the attr and text by using a coma-like shown in the code below.

<a data-bind="attr: { href: URL}, text: Name"></a>