// javascript
var
a = document.getElementsByTagName(
'a'
)[0]
a.addEventListener(
'click'
,
function
(){
if
(a.innerText ==
'123'
){a.innerText =
'456'
}
else
{a.innerText =
'123'
}
},
false
)
// jQuery
$(
'a'
).click(
function
(){
if
($(
this
).text() ==
'123'
)
{$(
this
).text(
'456'
)}
else
{$(
this
).text(
'123'
)}
})