Why the JavaScript code is ignored from wp editor?

onclick is not i the list of allowed attributes. It will be removed by kses. You can filter the list, use Extend KSES for example.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)