简体   繁体   中英

javascript-how can I see result of every condition in one if statement By Debugging in Chrome?

I Have some javascript code that has if statements with multiple conditions.

I want to see which one is true or false in chrome debugging.

for example:

if(a.value=='' || (document.getElementById('test') && document.getElementById('test').value==='') || myfom_upload.value==='' || document.forms['test_form']['name'].value==='' || document.getElementById('test_id').value==='' )
{
 //some codes.
}

I want to see result of:

(a.value=='') ====>(true or false)?

(document.getElementById('test')) ====>(true or false)?

document.getElementById('test') ====>(true or false)?

(document.getElementById('test').value==='') ====> (true or false)?

(myfom_upload.value==='') ====>(true or false)?

document.forms['test_form']['name'].value==='' ====>(true or false)?

document.getElementById('test_id').value==='' ====>(true or false)?

How can I see result of every condition in one if statement By Debugging in Chrome?

Is there anyway in console.log or something else?

Thanks

  1. Place your breakpoint on the line with the if condition
  2. Trigger the event that executes the code.
  3. When the execution pauses at the breakpoint, drag your cursor over to select a.value and hover over the selected text. You'll be able to see the value.
  4. Repeat

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM