help me understand what im doing wrong with this if else statement?

hello I am currently new to the Arduino and am starting to learn the code with the starting with electronics tutorial. I wrote the code for the if and else statement but the led wil light up for a split second and then turn off imideatly???? I copied his example after mine didn't work and it ended up with the same result?? im trying to get it so that a or A will light the LED while anything else will turn it off but all I get is a split second where the led will flash?? at first I though it was where the parethesis were located? Please help me understand

void setup() {
Serial.begin(9600);
pinMode(13,OUTPUT);

}

void loop() {
char rx_byte;
if (Serial.available() > 0) {
rx_byte = Serial.read();
if (rx_byte == 'a' || rx_byte == 'A') {
digitalWrite(13, HIGH);
}
else {
digitalWrite(13, LOW);
}
}

}

What is the serial monitor line ending set to?
Set it to "none" and retest.

Please remember to use code tags when posting code

code tags??

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

On the second pass through loop() (a few microSeconds later), Serial.available() == 0 and the IF falls through to ELSE and turns the LED off.

void loop() {
   static char rx_byte = 'b';
   if (Serial.available() > 0) { 
      rx_byte = Serial.read();
   }
    digitalWrite(13, (rx_byte == 'a' || rx_byte == 'A'));
}

Code tags: Type [code] before the first line of code, type [/code] after the last line.
If you right click in the editor window and select "Copy for Forum" you can then paste it from your clipboard into your reply, tags will be automatically included.
Or:
code tags.PNG

On the second pass through loop() (a few microSeconds later), Serial.available() == 0 and the IF falls through to ELSE and turns the LED off.

Nonsense. The if serial available statement does not have an else statement.

Although, with the piss-poor indentation, that is not so easy to see.

OP: Use Tools + Auto Format, to properly indent your code. And, delete the useless blank lines in the loop() function.