Asking direct question about attitude in online survey
While you will get numbers with such a question they won't mean anything. This is the sort of question that people will naturally skew toward "positive attitude" regardless of their actual attitude. The second method will also get you potentially inconsistent results. 

Instead, you need a set of questions that will be honestly answered, maybe responding to scenarios, and from which you can infer the attitude. 

Asking "Are you smart?" gets just noise. Some people answer the opposite of what they truly are for a variety of psychological reasons.