Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Add two-way binding #42

Open
dovy opened this issue May 25, 2019 · 1 comment
Open

Add two-way binding #42

dovy opened this issue May 25, 2019 · 1 comment

Comments

@dovy
Copy link
Contributor

dovy commented May 25, 2019

$("*[bind]").on('change keyup', function (e) {
 var to_bind = $(this).attr('bind');
 $("*[bind='"+to_bind+"']").html($(this).val());
 $("*[bind='"+to_bind+"']").val($(this).val());
})
$("div[bind]").bind("DOMSubtreeModified",function(){
 var to_bind = $(this).attr('bind');
 $("*[bind='"+to_bind+"']").html($(this).html());
 $("*[bind='"+to_bind+"']").val($(this).html());
}); 
@dovy
Copy link
Contributor Author

dovy commented May 25, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant