How to use javascript to increase or decrease the disabled attribute according to whether there is a