以下のコードに従って、このトグルボタンを機能させる方法を知っている人はいますか?最初のクリック後にのみ機能し、ボタンの値は変更されません
http://jsfiddle.net/ossama/2MbsG/
<script type='text/javascript'>
$(window).load(function () {
fill.addEventListener("click", function (event) {
if ($(this).attr('value') == 'Top Up') {
$('#fill').prev('.ui-btn-inner').children('.ui-btn-text').html('Stop');
$('#fill').buttonMarkup({
theme: "c"
});
} else {
$('#fill').prev('.ui-btn-inner').children('.ui-btn-text').html('Stopping');
$('#fill').buttonMarkup({
theme: "b"
});
}
});
});
</script>
</head>
<body>
<input id="fill" type="button" data-inline="true" value="Top Up" data-mini="true"
data-theme="c" />