문제

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