examples/todo/js/behaviors/todo.js
function(event, element, elementType) {

			if (elementType === 'mark-as-complete-checkbox') {
				var todoEl = getClosestTodoElement(element),
					todoId = getClosestTodoId(element);

				if (element.checked) {
					todoEl.classList.add('completed');
					todosDB.markAsComplete(todoId);
				} else {
					todoEl.classList.remove('completed');
					todosDB.markAsIncomplete(todoId);
				}

				context.broadcast('todostatuschange');

			}

		}
function(event, element, elementType) {

			if (elementType === 'mark-as-complete-checkbox') {
				var todoEl = getClosestTodoElement(element),
					todoId = getClosestTodoId(element);

				if (element.checked) {
					todoEl.classList.add('completed');
					todosDB.markAsComplete(todoId);
				} else {
					todoEl.classList.remove('completed');
					todosDB.markAsIncomplete(todoId);
				}

				context.broadcast('todostatuschange');

			}

		}
function ( event , element , elementType ) { if ( elementType === 'mark-as-complete-checkbox' ) { var todoEl = getClosestTodoElement ( element ) , todoId = getClosestTodoId ( element ) ; if ( element . checked ) { todoEl . classList . add ( 'completed' ) ; todosDB . markAsComplete ( todoId ) ; } else { todoEl . classList . remove ( 'completed' ) ; todosDB . markAsIncomplete ( todoId ) ; } context . broadcast ( 'todostatuschange' ) ; } }
Handles change events for the behavior.
@param {Event} event A DOM-normalized event object.
@param {HTMLElement} element The nearest HTML element with a data-type
attribute specified or null if there is none.
@param {string} elementType The value of data-type for the nearest
element with that attribute specified or null if there is none.
@returns {void}
Handles change events for the behavior .