Passing parameter using onclick or a click binding with KnockoutJS

前端 未结 5 2106
遥遥无期
遥遥无期 2020-12-25 09:54

I have this function:

function make(place)
{
  place.innerHTML = \"somthing\"
}

I used to do this with plain JavaScript and html:



        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-25 10:24

    Knockout's documentation also mentions a much cleaner way of passing extra parameters to functions bound using an on-click binding using function.bind like this:

    
    

提交回复
热议问题