문제

The question is simple, i want to trim an input text (with id title)and a textarea (with id description), how can i do? I only know how todo to the title id, but not both:

if (!$.trim($("#title)".val()))
도움이 되었습니까?

해결책

Something like this if both have to be empty

if ( !$.trim($("#title").val()) && !$.trim($("#description").val()) )

If just one empty is wrong, use

if ( !$.trim($("#title").val()) || !$.trim($("#description").val()) )
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top