Using L9110 (or HG7881) with external power supply

I want to drive a DC motor with a L9110 H bridge IC using an Arduino UNO with an external 12V power supply like this

The breadboard for the L9110 he is using is the following :

attached schematic

If VCC is 12V and IB and IA of the L9110 are conected to 12V and the connected to the 5V pins of the Arduino ... why the Arduino is not getting fried? I Guess the resistor has something to do with it but what is the reason for that? is there a better design?

There are protection clamping-diodes at i/o pins, in case the voltage at the pin exceeds Vdd+0.6V the upper diode will pass the excessive current into the Vdd. These diodes are usually rated for 5mA max.
Of course the schematics shows a sub-optimal solution, as the atmega does not possess an open-drain outputs.

markitus:
...If VCC is 12V and IB and IA of the L9110 are conected to 12V...

Motor power/ground is connected to VCC/ground of the L9110.
IA and IB are NOT connected to 12volt (that would instantly fry the L9110).

Ia and Ib are input/signal pins, and need a digital 5volt (PWM/direction) signal from the Arduino.
Leo..

Wawa:
Motor power/ground is connected to VCC/ground of the L9110.
IA and IB are NOT connected to 12volt (that would instantly fry the L9110).

Ia and Ib are input/signal pins, and need a digital 5volt (PWM/direction) signal from the Arduino.
Leo..

That's what I don't understand, If you look at the attached schematic IA and IB are connected to VCC = 12V throught a 10K resistors and also connected to the 5V arduino pins

Ahh, I see what you mean now.
Not sure about the switch points of the H-bridge inputs.
Datasheet mentions a typical HIGH switch point of 5volt on a 9volt motor supply.
You could have problems with that on a 12volt supply.
The resistors might have been added to add some extra pull up voltage.
The Arduino pin will clamp to ~5.6volt, as pito already has explained.
Leo..