Skip to content

Avoid change of a select input

Is there a way of not letting users change a select input?. I have a form with an already selected option, and I want to aware users that they are doing that and I was trying to do this. I have a select with id=users: One of the problems I have is that it only happens if I click on

What does [object Object] mean? (JavaScript)

One of my alerts is giving the following result: What does this mean exactly? (This was an alert of some jQuery object.) Answer It means you are alerting an instance of an object. When alerting the object, toString() is called on the object, and the default implementation returns [object Object]. If you want …

JavaScript shorthand ternary operator

I know that in PHP 5.3 instead of using this redundant ternary operator syntax: …we can use a shorthand syntax for our ternary operators where applicable: And I know about the ternary operator in JavaScript: …but is there a shorthand? Answer Something like that what you’re looking for, where…

HTML Select: How can you change the label when the is closed?

Consider this: The HTML above looks like #1 when open, and #2 when closed. How can I get the closed version to look like #3? The purpose is to also show the selected year without repeating it in the open options (so it looks cleaner). Answer My original (marked correct) answer is too old to be of use, so here

Use CMYK on web page

I need to use CMYK colors on my web page. Is there any way to use CMYK in CSS or may be convert CMYK to RGB using JavaScript? EDIT: I mean I have colors creating algorithm in CMYK notation and I need to use it on web page. Answer There is no perfect algorithmic way to convert CMYK to RGB.