Вопрос

I have a jquery datepicker widget that I'm using, and I want to overwrite the CSS associated with its input field.

Unfortunately, it looks like the id for that field is generated dynamically on page load:

<input type="text" id="dp1382434269539" style="position: absolute; top: 372.9375px; width: 0px; left: 579.8125px;">

We're using stylus and I'd like to be able to style any input that has and id that begins with "dp" -- is there an easy way to select an id this way?

Это было полезно?

Решение

Use the attribute selector for this. An example would be:

input[id^="dp"] {
    /* your styling */
}

jsFiddle example

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top